คู่มือ aWhere
พัฒนาAPIfile-services

ไฟล์

ส่งไฟล์เพื่อแสดงหรือบันทึก ส่งภาพย่อ และออกลิงก์ที่เซ็นชื่อแล้ว

ออกลิงก์ที่เซ็นชื่อให้ไฟล์

POST
/api/file/links

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

Body ของคำขอ

application/json
  1. body
files*array<>

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

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

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

พารามิเตอร์ใน Path

id*string

The id of the file, 32 hexadecimal characters.

พารามิเตอร์ใน Query

v?string

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

พารามิเตอร์ใน Header

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.

Body ของคำตอบ

The bytes.

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

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

พารามิเตอร์ใน Path

id*string

The id of the file, 32 hexadecimal characters.

พารามิเตอร์ใน Query

v?string

The version of the file.

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"
ว่าง

ส่งไฟล์ เพื่อบันทึก

GET
/api/file/{id}/download

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

พารามิเตอร์ใน Path

id*string

The id of the file, 32 hexadecimal characters.

พารามิเตอร์ใน Query

v?string

The version of the file, from a signed link.

พารามิเตอร์ใน Header

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.

Body ของคำตอบ

The bytes.

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

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

พารามิเตอร์ใน Path

id*string

The id of the file, 32 hexadecimal characters.

พารามิเตอร์ใน Query

v?string

The version of the file.

Body ของคำตอบ

The headers.

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

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

พารามิเตอร์ใน Path

id*string

The id of the file, 32 hexadecimal characters.

width*integer

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

ค่าที่รับ16032064012802048

พารามิเตอร์ใน Query

v?string

The version of the file, from a signed link.

Body ของคำตอบ

The image.

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

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

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

พารามิเตอร์ใน Path

id*string

The id of the file, 32 hexadecimal characters.

width*integer

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

ค่าที่รับ16032064012802048

พารามิเตอร์ใน Query

v?string

The version of the file.

Body ของคำตอบ

The headers.

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