Library Operations
Updated: 2022-7-18
- Create Library
- Modify Library
- Library Information
- Search Library
- Personal Library Information
- Set Personal Library
- Get Library List
- Get Library Authorization
- Cancel Library Authorization
- Get Library Members List
- Query Library Member Information
- Set Library Owner
- Add Library Member
- Modify Library Member Role
- Remove Library Member
- Get Library Departments List
- Add Department to Library
- Remove Department from Library
- Modify Department Role in Library
- Delete Library
- Library Logs
API Domain
Host: app.fileshow.com
Create Library
POST /m-open/1/org/create HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_name | Yes | Library name |
org_logo | No | Library icon URL |
org_capacity | No | Library storage capacity limit in bytes, default unlimited if not specified |
storage_point_name | No | Library storage point name, defaults to enterprise default storage |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
{
"org_id": Library ID,
"mount_id": Library space ID
}
Modify Library
POST /m-open/1/org/set HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | No | Library ID, either org_id or mount_id is required |
mount_id | No | Library space ID, either org_id or mount_id is required |
org_name | No | Library name, not passed if not to be modified |
org_logo | No | Library icon URL, not passed if not to be modified |
org_capacity | No | Library storage capacity limit in bytes, not passed if not to be modified, empty string indicates no limit |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
HTTP 200
Library Information
POST /m-open/1/org/info HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | No | Library ID, either org_id or mount_id is required |
mount_id | No | Library space ID, either org_id or mount_id is required |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
{
"info":
{
"org_id": Library ID,
"org_name": "Library Name",
"org_logo_url": "Library Icon URL",
"size_org_total": Total library space size in bytes, -1 indicates unlimited space,
"size_org_use": Used library space size in bytes,
"file_count": Number of files in the library excluding deleted ones,
"dir_count": Number of folders in the library excluding deleted ones,
"mount_id": Library space ID,
"owner_id": Library owner ID
}
}
Search Library
POST /m-open/1/org/search HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
name | No | Library name, exact match search, either name or prefix is required |
prefix | No | Library name prefix, fuzzy match search, either name or prefix is required |
size | No | Number of results to return, default 10 , max 1000 |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
{
"list":
[
{
"org_id": Library ID,
"org_name": "Library Name",
"org_logo_url": "Library Icon URL",
"size_org_total": Total library space size in bytes, -1 indicates unlimited space,
"size_org_use": Used library space size in bytes,
"mount_id": Library space ID,
"owner_id": Library owner ID, 0 indicates unspecified owner
},
...
]
}
Personal Library Information
POST /m-open/1/org/info_by_member HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
member_id | No | Member ID |
out_id | No | Member's external system unique ID |
account | No | Member's external system login account |
No | Query using email for regular public cloud accounts | |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Only one of member_id
, out_id
, account
, or email
is required.
Response
{
"info":
{
"org_id": Library ID,
"org_name": "Library Name",
"org_logo_url": "Library Icon URL",
"size_org_total": Total library space size in bytes, -1 indicates unlimited space,
"size_org_use": Used library space size in bytes,
"file_count": Number of files in the library excluding deleted ones,
"dir_count": Number of folders in the library excluding deleted ones,
"mount_id": Library space ID
}
}
Note: If the personal library is not initialized, only the space size set by the administrator will be returned.
{
"info":
{
"size_org_total": Total library space size in bytes, -1 indicates unlimited space
}
}
Set Personal Library
POST /m-open/1/org/set_by_member HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
member_id | No | Member ID |
out_id | No | Member's external system unique ID |
account | No | Member's external system login account |
No | Query using email for regular public cloud accounts | |
capacity | Yes | Library capacity in bytes, -1 indicates unlimited space |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Only one of member_id
, out_id
, account
, or email
is required.
Response
HTTP 200
Get Library List
POST /m-open/1/org/ls HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
type | No | 1 returns non-personal libraries, 2 returns personal libraries, default 0 returns all |
member_id | No | Returns only libraries in which this member participates |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
{
"list":
[
{
"org_id": Library ID,
"org_name": "Library Name",
"org_logo_url": "Library Icon URL",
"size_org_total": Total library space size in bytes, -1 indicates unlimited space
"size_org_use": Used library space size in bytes
"mount_id": Library space ID,
"owner_id": Library owner ID, 0 indicates unspecified owner
},
...
]
}
Get Library Authorization
POST /m-open/1/org/bind HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | No | Library ID, either Library ID or Library space ID must be passed |
mount_id | No | Library space ID, either Library ID or Library space ID must be passed |
title | Yes | Application or system name integrating with the library files |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
{
"org_client_id": "Library authorization client_id",
"org_client_secret": "Library authorization client_secret"
}
org_client_secret
is used as the key for API signature when calling Library File Operations.
Note: Each client_id
generates only one authorization for each library. Subsequent calls will return the previous authorization.
Cancel Library Authorization
POST /m-open/1/org/unbind HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_client_id | Yes | Library authorization |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
HTTP 200
Get Library Members List
POST /m-open/1/org/get_members HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | Yes | Library ID |
start | No | Starting position, default is 0 |
size | No | Number of records to return, default is 20 |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
{
"list":
[
{
"member_id": Member ID,
"out_id": Member's external ID,
"account": "Member's external account",
"member_name": "Member's display name",
"member_email": "Member's email",
"state": Member's state,
"role_id": Role ID
},
...
],
"count": Total number of members
}
Query Library Member Information
POST /m-open/1/org/get_member HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | Yes | Library ID |
ids | Yes | Member unique ID or account, multiple separated by commas , : id1,id2,id3 |
type | Yes | Type of ids : account , out_id , or member_id |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
{
"ids in request": {
"member_id": Member ID,
"out_id": "Member's external ID",
"account": "Member's external account",
"member_name": "Member's display name",
"member_email": "Member's email",
"state": Member's state,
"role_id": Role ID
},
...
}
Set Library Owner
POST /m-open/1/org/set_owner HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | Yes | Library ID |
member_id | Yes | Member ID to set as the library owner |
role_id | No | Role ID to assign to the original library owner, omit or empty to remove the current owner |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
HTTP 200
Add Library Member
POST /m-open/1/org/add_member HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | Yes | Library ID |
member_ids | Yes | Member IDs to add, separated by commas , |
role_id | Yes | Role ID |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
HTTP 200
Modify Library Member Role
POST /m-open/1/org/set_member_role HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | Yes | Library ID |
member_ids | Yes | Member IDs to modify, separated by commas , |
role_id | Yes | Role ID |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
HTTP 200
Remove Library Member
POST /m-open/1/org/del_member HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | Yes | Library ID |
member_ids | Yes | Member IDs, separated by commas , |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
HTTP 200
Get Library Departments List
POST /m-open/1/org/get_groups HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | Yes | Library ID |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
{
"list": [
{
"id": Department ID,
"name": "Department name",
"role_id": Role ID
},
...
]
}
Add Department to Library
POST /m-open/1/org/add_group HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | Yes | Library ID |
group_id | Yes | Department ID |
role_id | Yes | Role ID |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
HTTP 200
Remove Department from Library
POST /m-open/1/org/del_group HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | Yes | Library ID |
group_id | Yes | Department ID |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
HTTP 200
Modify Department Role in Library
POST /m-open/1/org/set_group_role HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | Yes | Library ID |
group_id | Yes | Department ID |
role_id | Yes | Role ID |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
HTTP 200
Delete Library
POST /m-open/1/org/destroy HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | - | Library ID |
org_client_id | - | Library authorization client ID, only one of org_client_id or org_id is required |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
Response
HTTP 200
Library Logs
POST /m-open/1/org/log HTTP/1.1
Request Parameters
Parameter | Required | Description |
---|---|---|
client_id | Yes | client_id obtained from enterprise authorization management |
org_id | No | Library ID, specify either org_id or mount_id to retrieve logs for that library |
mount_id | No | Library space ID, specify either org_id or mount_id to retrieve logs for that library |
act | No | Filter by operation, default returns all operations. Multiple operations can be separated by , |
orderby | No | asc for ascending order, default is desc for descending order |
start_dateline | No | Unix timestamp in seconds, retrieve logs where operation time >= start_dateline , default is unrestricted |
end_dateline | No | Unix timestamp in seconds, retrieve logs where operation time < end_dateline , default is unrestricted |
start | No | Starting position, default is 0 |
size | No | Number of logs to retrieve, default is 100 , maximum is 1000 |
dateline | Yes | Current Unix timestamp in seconds |
sign | Yes | Signature |
act Operations | Description |
---|---|
0 | Delete |
1 | Create or upload |
2 | Rename |
3 | Edit |
4 | Move |
5 | Restore deleted |
6 | Restore version |
12 | Lock |
13 | Unlock |
20 | Download |
21 | Preview |
1014 | Generate link |
1015 | Access link |
1016 | Download link file |
1017 | Save link file to cloud library |
1018 | Upload link file |
Response
Up to 1000 logs will be returned
{
"total": Total number of matched logs,
"list": [
{
"hash": "File unique ID",
"dir": 0,
"act": 1,
"filehash": "File content hash",
"filesize": File size,
"fullpath": "Full file path",
"member_id": User ID of operator,
"dateline": Operation time in seconds,
"act_name": "Operation name",
"member_name": "Operator's name (account)",
"display_name": "Operator's name",
"member_account": "Operator's account"
},
...
]
}