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

Drive

รายการใน Drive: แสดง สร้าง อัปโหลด คัดลอก ย้าย แชร์ ลบ และลบถาวร

คัดลอกรายการ

PUT
/api/drive/copy

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

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

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

Body ของคำขอ

application/json
  1. body
id*unknown

Body ของคำตอบ

The answer.

response?stringapplication/json

The id.

curl -X PUT "https://platform.example.com/api/drive/copy" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "id": "..."}'
"string"

สร้างรายการ

PUT
/api/drive/create-item

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

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

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

Body ของคำขอ

application/json
  1. body
name?string

The name.

description?string

A description.

organization?string

The organization.

hidden?unknown
type?string

The kind of Item.

subtype?string

The subtype of the Item.

parent?string

The id of the folder to put it in.

props?

The properties of the thing, by kind.

extendedProps?

Properties that Apps add, kept as they are.

Body ของคำตอบ

The answer.

response?stringapplication/json

The id.

curl -X PUT "https://platform.example.com/api/drive/create-item" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "name": "string",  "description": "string",  "organization": "string"}'
"string"

ย้ายรายการไปถังขยะ

PUT
/api/drive/delete

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

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

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

Body ของคำขอ

application/json
  1. body
ids*array<unknown>

The ids of the Items, as an array.

Body ของคำตอบ

The answer.

application/json
  1. response

The ids.

[index: integer]?string
curl -X PUT "https://platform.example.com/api/drive/delete" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "ids": []}'
[  "string"]

ลบรายการในถังขยะถาวร

PUT
/api/drive/erase

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

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

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

Body ของคำขอ

application/json
  1. body
ids*array<unknown>

The ids of the Items, as an array.

Body ของคำตอบ

The answer.

application/json
  1. response

The ids.

[index: integer]?string
curl -X PUT "https://platform.example.com/api/drive/erase" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "ids": []}'
[  "string"]
GET
/api/drive/explore

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

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

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

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

keyword?unknown

Words to look for.

type?string

Kinds of Item, separated by commas.

subtype?string

Subtypes of Item, separated by commas.

parent?string

The id of the folder. Without it, the top of Drive.

owner?string

me, notme, any or system, or the id of a user.

hidden?boolean

Include hidden Items.

ค่าเริ่มต้นfalse
trashed?boolean

Only the Items in the trash.

ค่าเริ่มต้นfalse
recursive?boolean

Search the folders inside the folder too.

ค่าเริ่มต้นfalse
importable?boolean

Only the Items that can take an import.

exportable?boolean

Only the Items that can be exported.

executable?boolean

Only the Items that can be run.

skip?integer

How many to skip.

limit?integer

How many to return.

sortBy?string

relevant only with a keyword.

ค่าที่รับ"name""lastModified""relevant"
sortOrder?string
ค่าที่รับ"ascending""descending"

Body ของคำตอบ

The answer.

application/json
  1. response
total?integer
data?array<unknown>
curl -X GET "https://platform.example.com/api/drive/explore" \  -H "Authorization: Bearer $TOKEN"
{  "total": 0,  "data": [    null  ]}
POST
/api/drive/explore

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

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

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

Body ของคำขอ

application/json
  1. body
keyword?unknown

Words to look for.

type?string

Kinds of Item, separated by commas.

subtype?string

Subtypes of Item, separated by commas.

parent?string

The id of the folder. Without it, the top of Drive.

owner?string

me, notme, any or system, or the id of a user.

hidden?boolean

Include hidden Items.

ค่าเริ่มต้นfalse
trashed?boolean

Only the Items in the trash.

ค่าเริ่มต้นfalse
recursive?boolean

Search the folders inside the folder too.

ค่าเริ่มต้นfalse
importable?boolean

Only the Items that can take an import.

exportable?boolean

Only the Items that can be exported.

executable?boolean

Only the Items that can be run.

skip?integer

How many to skip.

limit?integer

How many to return.

sortBy?string

relevant only with a keyword.

ค่าที่รับ"name""lastModified""relevant"
sortOrder?string
ค่าที่รับ"ascending""descending"

Body ของคำตอบ

The answer.

application/json
  1. response
total?integer
data?array<unknown>
curl -X POST "https://platform.example.com/api/drive/explore" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "keyword": "...",  "type": "string",  "subtype": "string"}'
{  "total": 0,  "data": [    null  ]}

นำข้อมูลในไฟล์เข้าฐานข้อมูล

PUT
/api/drive/import-data

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

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

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

Body ของคำขอ

application/json
  1. body
source?unknown
fileIndex?unknown
collectionIndex?unknown
createOptions?unknown
appendOptions?unknown
updateOptions?unknown

Body ของคำตอบ

The answer.

curl -X PUT "https://platform.example.com/api/drive/import-data" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "source": "...",  "fileIndex": "...",  "collectionIndex": "..."}'
ว่าง

ย้ายรายการไปโฟลเดอร์อื่น

PUT
/api/drive/move

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

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

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

Body ของคำขอ

application/json
  1. body
ids?array<unknown>

The ids of the Items, as an array.

parent?string

The id of the folder.

Body ของคำตอบ

The answer.

application/json
  1. response

The ids.

[index: integer]?string
curl -X PUT "https://platform.example.com/api/drive/move" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "ids": [],  "parent": "string"}'
[  "string"]

กู้คืนรายการจากถังขยะ

PUT
/api/drive/restore

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

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

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

Body ของคำขอ

application/json
  1. body
ids*array<unknown>

The ids of the Items, as an array.

Body ของคำตอบ

The answer.

application/json
  1. response

The ids.

[index: integer]?string
curl -X PUT "https://platform.example.com/api/drive/restore" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "ids": []}'
[  "string"]

ตั้งว่าใครเปิดรายการได้ (แชร์)

GET
/api/drive/share

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

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

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

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

permission*string

The permission, as a JSON object.

ids*string

The ids of the Items, as a JSON array.

recursive?string

true to set it on everything inside the folders too.

ค่าเริ่มต้นfalse

Body ของคำตอบ

The answer.

application/json
  1. response

The ids.

[index: integer]?string
curl -X GET "https://platform.example.com/api/drive/share?permission=VALUE&ids=VALUE" \  -H "Authorization: Bearer $TOKEN"
[  "string"]
GET
/api/drive/statistic

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

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

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

Body ของคำตอบ

One entry per kind of Item.

application/json
  1. response
[index: integer]?
curl -X GET "https://platform.example.com/api/drive/statistic" \  -H "Authorization: Bearer $TOKEN"
[  {    "_id": "string",    "total": 0,    "size": 0  }]

ล้างถังขยะ

DELETE
/api/drive/trash

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

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

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

Body ของคำตอบ

The answer.

curl -X DELETE "https://platform.example.com/api/drive/trash" \  -H "Authorization: Bearer $TOKEN"
ว่าง

แก้รายการ

PUT
/api/drive/update-item/{id}

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

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

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

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

id*string

The id of the Item.

Body ของคำขอ

application/json
  1. body
owner?unknown
parent?string

The id of the folder.

[key: string]?any

Body ของคำตอบ

The answer.

response?stringapplication/json

The id.

curl -X PUT "https://platform.example.com/api/drive/update-item/$ID" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "owner": "...",  "parent": "string"}'
"string"

อัปโหลดไฟล์เป็นรายการใหม่

PUT
/api/drive/upload

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

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

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

Body ของคำขอ

  1. body
file?file

A file.

รูปแบบbinary
parent?string

The id of the folder.

forceUpdate?string
ค่าเริ่มต้น"0"

Body ของคำตอบ

The answer.

response?stringapplication/json

The id.

curl -X PUT "https://platform.example.com/api/drive/upload" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "file": "@file",  "parent": "string",  "forceUpdate": "0"}'
"string"

อัปโหลดไฟล์เวอร์ชันใหม่

PUT
/api/drive/upload/{id}

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

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

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

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

id*string

The id of the Item.

Body ของคำขอ

  1. body
file?file

A file.

รูปแบบbinary
parent?string

The id of the folder.

forceUpdate?string
ค่าเริ่มต้น"0"

Body ของคำตอบ

The answer.

response?stringapplication/json

The id.

curl -X PUT "https://platform.example.com/api/drive/upload/$ID" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "file": "@file",  "parent": "string",  "forceUpdate": "0"}'
"string"