Skip to main content

Get Doc Meta API

MethodAPIDescription
GET/{context}/{docId}/meta?version=xx&action=xxGet the document metadata specified by docId and version, returned in JSON format.
ParameterRequiredLocationDescriptionTypeDefault Value
docIdYesPathSpecifies the file ID. Note that the file ID cannot contain colon ':'string
versionNoQueryFile version, if not filled, it is the latest version. For action is edit or not specified, version will be ignored.string
actionNoQueryaction specifies how the document is opened, the value can be edit or view. If there is no action parameter, it defaults to edit.string

Examples: Get http://172.16.52.223/v2/context/123/meta Get http://172.16.52.223/v2/context/123/meta?action=view Get http://172.16.52.223/v2/context/123/meta?action=view&version=asrt0yh3wekdh

Returns:

{
"id": "483", // Required
"name": "/study/Nodejs/Demo/mytest.xlsx", // Must include file extension, path name is optional
"modified_at": "2020-03-25T02:57:38.000Z", // Required, if not modified, use creation time
"created_by": { // Required
"id": "301", // Required
"email": "docstest02@lenovo.com", // Optional
"name": "docstest02" // Optional
},
"permissions": { // Required
"write": "true", // Required, controls whether the document can be edited
"read": "true", // Required
"download": false, // Optional
"print": true, // Optional
"copy": false // Optional, controls whether content can be copied to system clipboard
},
"size": 9897, // Required
"role": "commenter", // Optional, indicates the current user's role in the zoffice editor for the current document (only for text documents). This value can be "contributor", "commenter", "auditor".
"extension": { // Optional
"previewWithTrackChange": false, // true means revisions and comments can be displayed during preview. false or not providing this field means revisions and comments are not displayed during preview. Only for text documents.
"trackChangeForceOn": false, // true means revisions are automatically turned on during editing and cannot be turned off. false or not providing this field means revisions are not forced on during editing. Only for text documents.
"showPermMarkForceOn": false, // Normally, when a text document is in protected state, editable areas will be highlighted. When this value is true, editable areas will also be highlighted when the text document is not in protected state. Only for text documents.
"forceNewVersion": false // Normally, files with data protection do not allow editing of new versions uploaded by third-party systems. Users enable data protection in the online editor and set which users can edit which areas. If users upload a new version in the business system again. Because these settings cannot be completely saved to Office documents, if zOffice Server starts editing the newly uploaded file, these online setting contents may be lost. When this value is true, ignore protection information and directly edit the new version in the third-party system.
},
"waterMark": { // Optional
"line1": "李明 liming@lenovo.com", // For example, file last updater information
"line2": "张三 zhangshan@lenovo.com", // For example: file editor/previewer information
"line3": "", // For example: other custom text
"line4": "", // For example: other custom text
"withDate": true, // Whether to include date after each line of text
"fontcolor": "#FD4147", // RGB value
"transparent": 30, // 0 - 100, transparency. The smaller the value, the more obvious the transparent effect.
"rotation": 315, // Rotation angle 0 - 360, left tilt = 315, right tilt = 45, horizontal = 0
"fontsize": "72",
"font": "SimHei",
"spacing": 50 // Line spacing and column spacing are both 50 pixels
},
"owner": { // This is optional, if not provided, zOffice editor automatically uses created_by as owner
"id": "301",
"email": "docstest02@lenovo.com",
"name": "docstest02"
},
"modified_by": { // This is optional, if not provided, zOffice editor automatically uses created_by as modified_by
"id": "301",
"email": "docstest02@lenovo.com",
"name": "docstest02"
},
"description": "", // Optional
"created_at": "2020-03-25T02:57:38.000Z", // Optional
"version": "1" // Optional
}
Permission Related
  1. If the user does not have edit permission, return permissions.write = false in the JSON

  2. If the user does not have preview permission, return permissions.read = false in the JSON

  3. Whether the user has the ability to copy content externally depends on: permissions.copy, permissions.download

    If the permissions.copy attribute is not set, or set to false, check permissions.download. If the document has download permission, the user can copy content externally. If the document does not have download permission, the user cannot copy content externally.

    If the permissions.copy attribute is set to true, the user can copy content externally (regardless of whether the document has download permission).

Watermark Information

Watermark information. Watermarks can display up to four lines of text per group, tiled. If a line is set to an empty string, that line is not displayed. If watermark information is not set, watermark can be empty. Watermark settings can return content related to files and users, such as: the last modifier of a file of a specified version, the current file's editor/previewer.

modified_at Implementation Must Pay Attention

Please refer to: Cache Notes