API call description
When you call the Submit file API in a storage space, if the file name policy is set toOVERWRITE, uploading a file with the same name generates a historical version of the file.
Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/storage/spaces/{spaceId}/dentries/{dentryId}/versions |
| HTTP Method | GET |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Permission requirements | permission-Storage.File.Read-Organization storage file read permission |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. Obtain it as follows: - For an internal app, call the Get the access token of an internal app API. - For a third-party enterprise app, call the Get the access token of a third-party app’s authorized enterprise API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| spaceId | String | Yes | The space ID. Call the Add space API to get the value of the id parameter. |
| dentryId | String | Yes | The file ID. Call the Get a list of files or folders or Get spaceId and dentryId by dentryUuid API to get the value of the id parameter. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| nextToken | String | No | The pagination cursor. - For the first query, leave this parameter empty. - For subsequent queries, pass the nextToken returned by the previous call. |
| maxResults | Integer | No | The number of entries per page. Default: 100. Maximum: 100. |
| unionId | String | Yes | The unionId of the operator. Call the Query user details API to get the value of the unionid parameter. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| dentries | Array | The file version list. |
| id | String | The file ID. |
| spaceId | String | The ID of the space the file belongs to. |
| parentId | String | The parent directory ID. For the root directory, this parameter is 0. |
| type | String | The type: - FILE: file |
| name | String | The file name. |
| size | Long | The file size, in bytes. |
| path | String | The file path. |
| version | Long | The version. |
| status | String | The status: - NORMAL: normal - DELETED: deleted - EXPIRED: expired |
| extension | String | The file extension. |
| creatorId | String | The unionId of the creator. |
| modifierId | String | The unionId of the modifier. |
| createTime | String | The created time in ISO 8601 format. Example: 2022-07-29T14:55Z. |
| modifiedTime | String | The modified time in ISO 8601 format. Example: 2022-07-29T14:55Z. |
| properties | Object | The attribute list. |
| readOnly | Boolean | Whether the file is read-only: - true: yes - false: no |
| appProperties | Map<String, Array> | The attributes for a specific app. |
| Array | The attribute list. | |
| name | String | The attribute name. |
| value | String | The attribute value. |
| visibility | String | The attribute visibility: - PUBLIC: visible to all spaces - PRIVATE: visible only to the current space |
| uuid | String | The business identifier. |
| partitionType | String | The storage partition: - PUBLIC_OSS_PARTITION: public cloud OSS storage partition - MINI_OSS_PARTITION: dedicated MiniOSS storage partition |
| storageDriver | String | The driver type: - DINGTALK: DingTalk unified storage driver - ALIDOC: DingTalk Docs storage driver - UNKNOWN: unknown driver |
| nextToken | String | The pagination cursor. If this field is not empty, more data is available. |
Response body example
Error codes
If an error occurs when you call this API, refer to the Global error codes document for the solution based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | operationConcurrentControl | %s | Try again later. |
| 400 | paramError | %s | Parameter error. |
| 400 | paramError.spaceId | %s | Parameter error - spaceId. |
| 400 | paramError.parentId | %s | Parameter error - parentId. |
| 400 | paramError.maxResults | %s | Parameter error - maxResults. |
| 403 | permissionDenied | %s | The user does not have permission to get file (folder) information. |
| 500 | systemError | %s | System error. |
| 500 | unknownError | Unknown Error | Unknown error. |
| 503 | operationTimeout | %s | Request timed out. |