aWhere Manual
DevelopAPIfile-services

Files

Send a file to be shown or saved, send a thumbnail, and issue signed links.

POST
/api/file/links

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Request Body

application/json
  1. body
files*array<>

What to make links for. An entry that is not well formed is dropped.

Response Body

The links.

application/json
  1. response
links?

By file id, then by use: content, download or thumbnail/<width>. Each is a path to open with GET.

image?

By file id: the size and the placeholder of an image file.

denied?array<string>

The ids of the files that the caller cannot read, or that do not exist.

curl -X POST "https://platform.example.com/api/file/links" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "files": [    {      "id": "FILE_ID",      "use": "content"    },    {      "id": "FILE_ID",      "use": "thumbnail",      "width": 320    }  ]}'
{  "links": {    "property1": {      "property1": "string",      "property2": "string"    },    "property2": {      "property1": "string",      "property2": "string"    }  },  "image": {},  "denied": [    "string"  ]}
GET
/api/file/{id}/content

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the file, 32 hexadecimal characters.

Query Parameters

v?string

The version of the file, from a signed link. A request with v can be cached for a long time.

Header Parameters

Range?string

One range of bytes, such as bytes=0-1023.

If-None-Match?string

The ETag you have.

If-Range?string

The ETag that the Range is of.

Response Body

The bytes.

response?fileapplication/octet-stream
Formatbinary
curl -X GET "https://platform.example.com/api/file/$FILE_ID/content" \  -H "Authorization: Bearer $TOKEN"
"string"
HEAD
/api/file/{id}/content

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the file, 32 hexadecimal characters.

Query Parameters

v?string

The version of the file.

Response Body

The headers: Content-Type, Content-Length, ETag and Accept-Ranges.

curl -X HEAD "https://platform.example.com/api/file/$FILE_ID/content" \  -H "Authorization: Bearer $TOKEN"
Empty
GET
/api/file/{id}/download

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the file, 32 hexadecimal characters.

Query Parameters

v?string

The version of the file, from a signed link.

Header Parameters

Range?string

One range of bytes, such as bytes=0-1023.

If-None-Match?string

The ETag you have.

If-Range?string

The ETag that the Range is of.

Response Body

The bytes.

response?fileapplication/octet-stream
Formatbinary
curl -X GET "https://platform.example.com/api/file/$FILE_ID/download" \  -H "Authorization: Bearer $TOKEN"
"string"
HEAD
/api/file/{id}/download

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the file, 32 hexadecimal characters.

Query Parameters

v?string

The version of the file.

Response Body

The headers.

curl -X HEAD "https://platform.example.com/api/file/$FILE_ID/download" \  -H "Authorization: Bearer $TOKEN"
Empty
GET
/api/file/{id}/thumbnail/{width}

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the file, 32 hexadecimal characters.

width*integer

The width in pixels: 160, 320, 640, 1280 or 2048.

Value in16032064012802048

Query Parameters

v?string

The version of the file, from a signed link.

Response Body

The image.

response?fileimage/*
Formatbinary
curl -X GET "https://platform.example.com/api/file/$FILE_ID/thumbnail/$WIDTH" \  -H "Authorization: Bearer $TOKEN"
"string"
HEAD
/api/file/{id}/thumbnail/{width}

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the file, 32 hexadecimal characters.

width*integer

The width in pixels: 160, 320, 640, 1280 or 2048.

Value in16032064012802048

Query Parameters

v?string

The version of the file.

Response Body

The headers.

curl -X HEAD "https://platform.example.com/api/file/$FILE_ID/thumbnail/$WIDTH" \  -H "Authorization: Bearer $TOKEN"
Empty