Library File Operations

Updated: 2022-10-20

API Domain

Host: app.fileshow.com

Note: The secret used for Library File Operations API is obtained after Library Authorization as org_client_secret.

Parameter Description

sign

Refer to the algorithm explanation in Access Control to calculate the signature for the API request parameters. If the API returns an error: error_code=401041, it indicates a signature verification failure, possibly due to inconsistent Chinese encoding.

All API parameters must be UTF-8 encoded and URL encoded as per the convention.

fullpath

The complete path of a file or folder in the file library.

Examples:

fullpath=readme.txt represents a file named readme.txt located in the root directory of the library.

fullpath=documents/project.docx represents a file named project.docx located in the documents folder.

filename

The name of the file or folder. There cannot be two files or folders with the same filename in the same directory.

hash

The unique identifier for a file or folder in the file library. Renaming or moving does not change the hash value.

filehash

The checksum of the file content, which uniquely identifies the file content. Different filenames with the same content will have the same filehash.

op_id

Specifies the operator's ID, i.e., the user ID in the cloud library.

op_name

Specifies the operator's name. The API is designed to perform operations with the highest permissions. To display the specific operator's name in the cloud library interface, op_name can be used to designate the display name.


File List

POST /m-open/1/file/ls HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Folder path, an empty string indicates the root directory
tag No Returns all files and folders with the specified tag under fullpath at all levels
start No Starting position, default is 0
size No Number of entries to return, default is 100
hashs No Retrieves files with the specified hashes, separated by commas ,
dateline Yes Current unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

{
    count:
    list:
    [
        {
            hash:
            dir:
            fullpath:
            filename:
            filehash:
            filesize:
            create_member_name:
            create_dateline:
            last_member_name:
            last_dateline:
            property:
        },
        ...
    ]
}
Field Type Description
count number Total number of files
list array Format as shown below
Field Type Description
hash string Unique identifier for the file
dir number Indicates if it is a folder, 1 for yes, 0 for no
fullpath string File path
filename string File name
filehash string File content hash, empty if it is a folder
filesize number File size, 0 if it is a folder
create_member_name string Name of the file creator
create_dateline number Creation timestamp
last_member_name string Name of the last person who modified the file
last_dateline number Last modification timestamp
property object {"tag": "Tag", "op_name": "Operator Name", "inherit": 0/1 whether the folder inherits permissions from parent, "permission": File permissions}
  • Multiple tags in property's tag field are separated by semicolons ;.

Recent File Updates

POST /m-open/1/file/updates HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
mode No Fetch mode, either empty or compare, details below
fetch_dateline Yes Unix timestamp, in milliseconds, default is 0
dir No Retrieve files or folders, do not pass to return both, 1 returns only folders, 0 returns only files
dateline Yes Current unix timestamp in seconds
sign Yes Signature

Notes

  • When mode is empty, it fetches data in descending order by operation time, retrieving data earlier than fetch_dateline. If fetch_dateline is not provided, empty, or 0, it starts fetching the list from the current time and does not include deleted files in the returned list.

  • When mode = compare, it fetches data in ascending order by operation time, retrieving data later than fetch_dateline. If fetch_dateline = 0, it starts fetching the list from the earliest operated file and includes deleted files in the returned list.

  • Each request will return a maximum of 100 entries. To retrieve all data, use the fetch_dateline from the previous response for the next request.

  • Locking, unlocking, tag changes, and permission changes also update the operation time.

Response Format

json

Response

Field Type Description
fetch_dateline number In milliseconds; when mode is empty, returns the smallest operation time in the list; when mode is compare, returns the largest operation time in the list
list array Format as shown below
Field Type Description
cmd number Returned only when mode=compare, 0 indicates deleted, 1 indicates not deleted
hash string Unique identifier for the file
dir number Indicates if it is a folder, 1 for yes, 0 for no
fullpath string File path
filename string File name
filehash string File content hash, empty if it is a folder
filesize number File size, 0 if it is a folder
create_member_name string Name of the file creator
create_dateline number Creation timestamp in seconds
last_member_name string Name of the last person who modified the file
last_dateline number Last modification timestamp in seconds

File Update Count

POST /m-open/1/file/updates_count HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
begin_dateline Yes Unix timestamp, in milliseconds, start time
end_dateline Yes Unix timestamp, in milliseconds, end time
showdel No 1 to include deleted files, default is 0 to exclude
dateline Yes Current unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

{
    count: Number of updates
}

POST /m-open/1/file/download_url HTTP/1.1

File download links typically have a validity period of only 10 minutes. After expiration, the download link cannot be used. Depending on the storage type, multiple download links may be returned.

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
fullpath - File path; either fullpath or hash must be provided
hash - Unique identifier of the file; either fullpath or hash must be provided
filehash No Unique identifier of the file content, used to download historical versions. If not provided, the current version will be downloaded
open No 1 to return a link that can be opened directly in a browser, default is 0
filename No Specifies the download filename, default is to use the original name
net No in to get an intranet download link; default is to return a public link
op_id - Operator ID, if the operator is not a cloud library user, op_name can be used instead
op_name - Operator name, if op_id is specified, op_name is not needed
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

{
    "urls": [Array of file download links (multiple links may be provided)]
}

POST /m-open/1/file/preview_url HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
fullpath - File path; either fullpath or hash must be provided
hash - Unique identifier of the file; either fullpath or hash must be provided
watermark No 1 to display a watermark, default is 0 (no watermark)
member_name No Name of the document viewer to display in the watermark
thumbnail No 1 to return a thumbnail link for images, default is 0 (no thumbnail)
op_id - Operator ID, if the operator is not a cloud library user, op_name can be used instead
op_name - Operator name, if op_id is specified, op_name is not needed
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Annotation feature must be enabled. Only supported for PDF and image files.

Name Required Description
org_client_id Yes Library authorization client_id
fullpath - File path; either fullpath or hash must be provided
hash - Unique identifier of the file; either fullpath or hash must be provided
annotation Yes on to enable annotations, display to open the side annotation list by default
annotation_mode No Annotation mode, default is to allow adding annotations; view to allow only viewing, admin to allow modifying and deleting annotations. If the annotation operator is not specified, the mode is forced to view
op_id - Operator ID, can use out_id or account instead
out_id - External system account ID of the operator
account - External system account of the operator
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

{
    "url": Document preview link (valid for 10 minutes),
    "thumbnail": Thumbnail link (supported for image files only)
}

Preview Page Event Notifications

Use iframe to embed the preview page and add an event listener for message events.

<iframe frameborder="0" src="{Preview URL}"></iframe>
<script type="text/javascript">
window.addEventListener('message', function (e) {
    try {
        const msg = JSON.parse(e.data);
        if (typeof msg === 'object' && msg.type == 'GK_VIEWER_EVENT') {
            // msg structure is explained below
        }
    } catch (err) {
        console.error(err);
    }
});
</script>

msg Structure

  • For documents, triggered upon successful load and page change.
{
  "type": "GK_VIEWER_EVENT",
  "page": {
    "current": 1,
    "total": 23
  },
  "time": 1612839014841
}
  • For videos and audio, triggered at the start and end of playback, and every 5 seconds during playback.
{
  "type": "GK_VIEWER_EVENT",
  "progress": {
    "current": 18.208222,
    "total": 1260.34
  },
  "time": 1612839014841
}

current and total units: seconds


Note: Collaborative editing feature must be enabled and is only supported for Office documents.

POST /m-open/1/file/cedit_url HTTP/1.1

Important: Collaborative editing does not support anonymous editing. You must specify the editor using one of the parameters op_id, out_id, or account.

Name Required Description
org_client_id Yes Library authorization client_id
fullpath - File path; either fullpath or hash must be provided
hash - Unique identifier of the file; either fullpath or hash must be provided
readonly - 1 to open in read-only mode; default allows editing
timeout - Expiry time for the editing link, in seconds. Default is 3600 (1 hour)
op_id - Operator ID; can use out_id or account instead
out_id - External system account ID of the operator
account - External system account of the operator
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

{
    "url": Collaborative editing link
}

File/Folder Information

Note: This API returns a large amount of data and can consume significant server resources. Use with caution.

POST /m-open/1/file/info HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
fullpath - File path; either fullpath or hash must be provided
hash - Unique identifier of the file; either fullpath or hash must be provided
net No in to get an intranet download link; default returns a public link
attribute No 1 to get additional attributes including count and size of sub-files and sub-folders; 10 returns only basic information; default is 0
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

Default response:

{
    hash: "Unique file identifier",
    dir: 1 or 0 (indicates if it's a directory),
    fullpath: "Full file path",
    filename: "File name",
    filesize: File size,
    create_member_name: "Name of the person who created the file",
    create_dateline: File creation timestamp (10-digit, accurate to seconds),
    last_member_name: "Name of the last person who modified the file",
    last_dateline: File's last modification timestamp (10-digit, accurate to seconds),
    uri: "File download link",
    preview: "File preview link",
    thumbnail: "Thumbnail link (only for image files)",
    tag: "File tag",
    file_count: Number of sub-files,
    folder_count: Number of sub-folders,
    files_size: Size of sub-files,
    property: {
        "tag": "Tags", 
        "op_name": "Operator name", 
        "inherit": 0 or 1 (indicates if folder permissions are inherited from the parent), 
        "permission": "File permissions"
    }
}

Response when attribute=10:

{
    hash: "Unique file identifier",
    dir: 1 or 0 (indicates if it's a directory),
    fullpath: "Full file path",
    filename: "File name",
    filehash: "File content hash",
    filesize: File size
}
Field Type Description
hash string Unique file identifier
dir number Indicates if it's a directory (1 for yes, 0 for no)
fullpath string Full file path
filename string File name
filehash string File content hash
filesize number File size
create_member_name string Name of the person who created the file
create_dateline number File creation timestamp (10-digit, accurate to seconds)
last_member_name string Name of the last person who modified the file
last_dateline number File's last modification timestamp (10-digit, accurate to seconds)
uri string File download link
preview string File preview link
thumbnail string Thumbnail link (only for image files)
tag string File tag
file_count number Number of sub-files
folder_count number Number of sub-folders
files_size number Size of sub-files
property object {"tag": "Tags", "op_name": "Operator name", "inherit": 0 or 1 (indicates if folder permissions are inherited from the parent), "permission": "File permissions"}
  • property's tag field allows multiple tags separated by a semicolon ;.

POST /m-open/1/file/search HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
keywords Yes Search keywords
path No Folder to search in; default is to search the entire library
scope No JSON string, default is ["filename","tag"], filename for file names, tag for tags, content for full-text search
start No Start position, default is 0
size No Number of results to return, default is 100
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

Same as File List.


Create Folder

POST /m-open/1/file/create_folder HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Folder path
op_id - Operator ID; for personal libraries, the default is the library owner's ID. If the operator is not a cloud library user, op_name can be used instead
op_name - Operator name; if op_id is specified, op_name is not needed
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

{
    "hash": "Unique folder identifier",
    "fullpath": "Full folder path"
}

Upload File

Upload files using chunked upload method.

Step 1: Request Upload

POST /m-open/1/file/create_file HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Full file path
filehash Yes SHA1 hash value of the file content, 40 bytes, lowercase English letters, not included in signature calculation
filesize Yes File size, not included in signature calculation
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
overwrite No Whether to overwrite existing files with the same name. 1 for overwrite, default is 0 (do not overwrite)
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

Field Type Description
hash string Unique file identifier
fullpath string Full file path
state number Whether to call chunked upload, 0 for required, 1 for not required (already uploaded)
server string Upload server

Step 2: Chunked File Upload

Refer to documentation: Chunked Upload


Web Upload

Directly upload files via web form.

Step 1: Get Upload Server

Note: Use backend code to call this API to prevent org_client_secret leakage.

POST /m-open/1/file/upload_servers HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Full file path
timeout Yes Validity period of the upload temporary key, in seconds. E.g., 300 for 5 minutes
rand Yes Random string of any length
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

{
    "m-upload": [
        "http://upload_server",
        ...
    ],
    "key": "Upload key"
}
Name Description
m-upload Array of upload servers; choose one randomly. Each server includes protocol and port.
key Temporary upload key for use during actual file upload. The key will expire after timeout seconds.

Step 2: Upload File

Use multipart/form-data form data to upload files.

POST /2/web_upload HTTP/1.1
Host: {upload_server}
Content-Type: multipart/form-data; boundary=xxxxx

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
key Yes Temporary upload key
path Yes Target folder for upload; use empty string for root directory
name Yes File name
overwrite No Whether to overwrite existing files with the same name. 1 for overwrite, default is 0 (do not overwrite)
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
filefield Yes Fixed value file
file Yes File content to upload

Response Format

{
    "fullpath": "Full file path",
    "filesize": File size,
    "hash": "Unique file identifier"
}

Copy File/Folder

Basic Copy

POST /m-open/1/file/copy HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
from_fullpath Yes Source file path
fullpath Yes Destination file full path (including filename)
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

{
  "hash": "Unique file identifier",
  "fullpath": "Full file path",
  "queue_id": "Queue ID"
}

Note: If queue_id is returned, it indicates the operation has entered the asynchronous processing queue. The request completion does not signify the operation's completion. Use Check Queue Status to query execution results.


Advanced Copy File/Folder

POST /m-open/1/file/mcopy HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
from_fullpaths Yes Source file paths; separate multiple paths with vertical bar ` `
paths Yes Target folder (without filename); separate multiple copies with vertical bar ` `
copy_all No 1 to copy all file properties, including operator; default is 0 (do not copy)
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
sp No Special parameter; reserved
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

[
  {
    "hash": "Unique file identifier",
    "fullpath": "Full file path",
    "queue_id": "Queue ID"
  },
  ...
]

Field details as per Copy File/Folder.


Move File/Folder

POST /m-open/1/file/move HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Path of the file to move
dest_fullpath Yes Destination path after moving (including filename)
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

HTTP 200


Delete File/Folder

POST /m-open/1/file/del HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath - Full file path; use fullpath or tag, not both
tag - Delete by tag; separate multiple tags with semicolon ;, use path when deleting via tag, default is empty
path - Path; when deleting via tag, specify the path for deletion, default is empty
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
destroy No 1 to permanently delete the file without sending to recycle bin; default is 0 to move the file to recycle bin
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

HTTP 200


Permanently Delete File/Folder

POST /m-open/1/file/del_completely HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpaths - File paths; separate multiple paths with vertical bar ` `
tag - Delete by tag; separate multiple tags with semicolon ;, use fullpaths or tag, not both
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

HTTP 200


Recycle Bin

List Recycled Files

POST /m-open/1/file/recycle HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
start No Starting position, default is 0
size No Number of entries to return, default is 100
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

{
    count: number,
    list: [
        {
            hash: string,
            dir: number,
            fullpath: string,
            filename: string,
            filehash: string,
            filesize: number,
            create_member_name: string,
            create_dateline: number,
            last_member_name: string,
            last_dateline: number
        },
        ...
    ]
}
Field Type Description
count number Total number of files
list array Array format as shown above
Field Type Description
hash string Unique file identifier
dir number Whether it's a directory (1 for yes, 0 for no)
fullpath string File path
filename string File name
filehash string File content hash; empty if it's a directory
filesize number File size; 0 if it's a directory
create_member_name string Name of the member who created the file
create_dateline number Timestamp when the file was created (seconds since Unix epoch)
last_member_name string Name of the member who last modified the file
last_dateline number Timestamp when the file was last modified (seconds since Unix epoch)

Restore Deleted File

POST /m-open/1/file/recover HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpaths Yes File paths; separate multiple paths with vertical bar ` `
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

HTTP 200


Get File History

POST /m-open/1/file/history HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes File full path
start No Starting position, default is 0
size No Number of entries to return, default is 20
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

{
  "count": number,
  "list": [
    {
      "hid": string,
      "act": number,
      "act_name": string,
      "dir": number,
      "hash": string,
      "fullpath": string,
      "filehash": string,
      "filesize": number,
      "member_id": number,
      "member_name": string,
      "dateline": number,
      "property": string
    },
    ...
  ]
}
Field Type Description
count number Total number of history entries
list array Array format as shown above
Field Type Description
hid string History version ID
act number Specific file operation type
act_name string Description of specific file operation type
dir number Whether it's a directory (1 for yes, 0 for no)
hash string Unique file identifier
fullpath string File path
filehash string File content hash; empty if it's a directory
filesize number File size; 0 if it's a directory
member_id number ID of the member who performed the file operation
member_name string Name of the member who performed the file operation
dateline number Timestamp of the file operation (seconds since Unix epoch)
property string Extended properties like machine, IP, etc.

POST /m-open/1/file/link HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes File full path
deadline No Expiration timestamp, default is 48 hours later
auth No Access permissions: preview for file preview, download for file preview and download, upload for preview, download, and folder upload. Default is preview
password No Access password
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

json

Response

{
  "link": "File external link",
  "code": "Link code"
}

POST /m-open/1/file/link_close HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
code - Link code to close the corresponding external link
fullpath - File full path; close all links for this file
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Note: Only code or fullpath needs to be provided, not both.

Response

HTTP 200


POST /m-open/1/file/links HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
file No Whether to return only files: 1 for files only, 0 for all. Default is 0
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response

[
    {
        "filename": "File name or folder name",
        "filesize": File size,
        "link": "File external link",
        "deadline": Expiration timestamp (-1 means permanent validity),
        "password": Whether encrypted, 1 for encrypted, 0 for not
    },
    ...
]

Set Folder Permission Inheritance Status

POST /m-open/1/file/set_permission_inherit

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Folder full path
inherit Yes 1 to inherit permissions, 0 to not inherit
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response

HTTP 200


Get Individually Set Folder Permissions

Note: Returns only permissions set specifically for the folder, not inherited from parent or department

POST /m-open/1/file/get_all_permission HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Folder full path
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response

See Permission Response Format


Modify Folder Permissions

POST /m-open/1/file/file_permission HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Folder full path
permissions Yes Permissions, such as {user_id: ["file_preview", "file_read"], ...} or {department_id: ["file_preview", "file_read"], ...}
is_group No 1 to set department permissions, default 0 for user permissions
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response

HTTP 200


Reset or Remove Folder Permissions

POST /m-open/1/file/reset_permission HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Folder full path
members - Member IDs to reset/remove, separated by commas ,
groups - Department IDs to reset/remove, separated by commas ,
clear No Clear permissions for members joined through departments. Effective only when the folder is not in inheritance mode. Default is 0. See notes below for details.
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Notes:

  • When the folder is in inheritance mode, this operation will reset permissions for specified members or departments to match those of the parent folder. If members are joined through departments, their permissions will align with the department's permissions after reset.
  • When the folder is not in inheritance mode, this operation will remove specified members or departments. If members are joined through departments and cannot be removed directly, use the clear parameter:
    1. Not specifying or specifying 0 will reset member permissions to match the department's permissions.
    2. Specifying 1 will clear member permissions.

Response

HTTP 200


Get File Permissions

POST /m-open/1/file/get_permission HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes File full path
member_id - User ID. Specify member_id, out_id, or account. If not specified, returns permissions for all users who have permissions for this file/folder.
out_id - User external system account ID. Specify member_id, out_id, or account.
account - User external system account. Specify member_id, out_id, or account.
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response

If a user is specified:

[
  "file_read",
  "file_preview",
  "file_write",
  "file_delete"
]

If no user is specified, see Permission Response Format, where only members are returned.


Add Tags

POST /m-open/1/file/add_tag HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes File full path
tag Yes Tags, separated by semicolons ;
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response

HTTP 200


Delete Tags

POST /m-open/1/file/del_tag HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath Yes File full path
tag Yes Tags, separated by semicolons ;
op_id - Operator ID; for personal libraries, default is library owner's ID. Use op_name if operator is not a cloud library user
op_name - Operator name; not needed if op_id is specified
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response

HTTP 200


Add or Modify Metadata

Metadata templates and properties need to be configured on the enterprise management backend as needed, and associated with file libraries.

POST /m-open/1/file/set_metadata HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath - File path; pass either fullpath or hash
hash - File unique identifier; pass either fullpath or hash
key Yes Metadata template key
metadata Yes JSON Object string
display No Properties displayed on the file list; values are property keys, separated by commas ,
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Note

  • The metadata parameter is a JSON Object string containing the metadata properties to add or modify. Keys in the JSON Object correspond to the metadata property keys.

For example, setting archive status and archive time: Archive status key is 4736_620f629b9d63f (string type), archive time key is 4736_62b93d22140fc (datetime type).

{
    "4736_620f629b9d63f": "Archived",
    "4736_62b93d22140fc": "2022-03-01 12:00:00",
    ...
}

Examples of values for various property types:

Property Type Value
String "Archived"
Number 9820
Date "2022-03-01"
Time "2022-03-01 12:00:00"
Single Select "1"
Multiple Select ["Red", "Green", "Blue"]
  • The display parameter specifies which properties should be displayed on the file list. If not specified, properties will not be displayed on the file list.

Response

HTTP 200


Delete Metadata

POST /m-open/1/file/del_metadata HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
fullpath - File path; pass either fullpath or hash
hash - File unique identifier; pass either fullpath or hash
key Yes Metadata template key
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response

HTTP 200


Statistics

POST /m-open/1/file/stat HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response

{
    "org_id": ,
    "org_name": ,
    "mount_id": ,
    "capacity": ,
    "size": ,
    "size_recycle": ,
    "count_file": ,
    "storage_point": 
}
Field Type Description
org_id number Library ID
org_name string Library name
mount_id number Library space ID
capacity number Space quota, in bytes
size number Used space, in bytes
size_recycle number Space used by the recycle bin, in bytes
count_file number Number of files, excluding folders
storage_point string Storage point

Query Queue Status

POST /m-open/1/file/queue_status HTTP/1.1

Request Parameters

Parameter Required Description
org_client_id Yes Library authorization client_id
queue_id Yes Queue ID
dateline Yes Current Unix timestamp in seconds
sign Yes Signature

Response Format

JSON

Response

{
  "status": Status,
  "fullpath": "Full path",
  "add_dateline": Timestamp when added to queue,
  "start_dateline": Timestamp when processing started,
  "finish_dateline": Timestamp when processing finished
}
Field Type Description
status number Status: 0 for just added to queue, 1 for processing, 2 for completed, 3 for error
fullpath string Full file path
add_dateline number Timestamp when added to queue, in seconds
start_dateline number Timestamp when processing started, in seconds
finish_dateline number Timestamp when processing finished, in seconds

Permission Response Format

{
  "members":
  {
    "User_ID":
    [
      "file_preview",
      "file_read",
      "file_upload",
      "file_write",
      "file_delete",
      "file_link"
    ],
    ...
  },
  "groups":
  {
    "Department_ID":
    [
      "file_preview",
      "file_read",
      "file_upload",
      "file_write",
      "file_delete",
      "file_link"
    ],
    ...
  }
}
Permissions Description
file_preview Preview
file_read Download
file_upload Create/Upload
file_write Modify/Overwrite version
file_delete Delete
file_link Generate link