API description
For images, WPS-format documents (Word, Excel, and PowerPoint), PDF files, and TXT files uploaded to a storage space, thumbnails are generated automatically and asynchronously. Call this API to get the thumbnail information of stored files in batch.Permissions
To call this API, one of the following permissions is required.| App type | Supported | Permissions | API Explorer Debug |
|---|---|---|---|
| Internal app | Supported | Read permission for organization storage files | API Explorer |
| Third-party enterprise app | Supported | Read permission for organization storage files | API Explorer |
| Third-party personal app | Not supported | Read permission for organization storage files | Not supported |
HTTP method
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. Obtain it as follows: - For internal apps, call the Get the access token of an internal app API. - For third-party enterprise apps, call the API for getting the access token of an organization authorized for a third-party app. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| spaceId | String | Yes | The space ID. Obtain the value of the id parameter by calling the Add space API. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| unionId | String | Yes | The unionId of the operator. Obtain it by calling the Query user details API. |
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
| dentryIds | Array of String | Yes | The file IDs. The maximum number is 30. Obtain the value of the id parameter by calling the API for getting the list of files or folders. |
Response parameters
| Name | Type | Description |
|---|---|---|
| resultItems | Array | The list of thumbnail retrieval results. |
| spaceId | String | The ID of the space where the file is located. |
| dentryId | String | The file ID. |
| success | Boolean | Whether the thumbnail information was retrieved successfully. true indicates success. |
| errorCode | String | The error reason. |
| thumbnail | Object | The thumbnail information. |
| width | Integer | The width of the thumbnail, in px. |
| height | Integer | The height of the thumbnail, in px. |
| url | String | The URL of the thumbnail. |
Examples
Request example
HTTPResponse example
Error codes
| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | paramError | %s | Parameter error |
| 400 | paramError.spaceId | %s | Parameter error - spaceId |
| 400 | paramError.dentryIds | %s | Parameter error - dentryIds |
| 400 | permissionDenied | %s | No permission to get thumbnails |
| 400 | dentryNotExist | %s | The file does not exist |
| 400 | dentryFormatNotSupport | %s | Thumbnails are not supported for this format |
| 400 | fileViral | %s | Virus-infected file |
| 400 | fileMalicious | %s | Malicious file |
| 403 | thumbnailNotExist | %s | The thumbnail does not exist |
| 500 | systemError | %s | System error |
| 500 | unknownError | Unknown Error | Unknown error |