Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/storage/recycleBins/{recycleBinId}/recycleItems/batchRestore |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | permission-Storage.RecycleBin.Write-Write permission on files in the Drive app Recycle Bin |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential used to call this API. Obtain it as follows: - For an internal app, call the Obtain the access token of an internal app API. - For a third-party enterprise app, call the Obtain the access token of an organization that has authorized the third-party app API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| recycleBinId | String | Yes | The Recycle Bin ID. Call the Obtain Recycle Bin information API to get it. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| unionId | String | Yes | The unionId of the operator. Call the Query user details API to get it. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| recycleItemIds | Array of String | Yes | The list of recycle item IDs. Call the Get the list of recycle items API to get them. The maximum number is 30. |
| option | Object | No | Optional parameters. |
| conflictStrategy | String | No | The file name conflict strategy. A file with the same name may already exist in the original path when restoring. - AUTO_RENAME: Automatically rename. Default value. - OVERWRITE: Overwrite. - RETURN_DENTRY_IF_EXISTS: Return the existing file. - RETURN_ERROR_IF_EXISTS: Return an error if the file already exists. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| resultItems | Array | The result list of the batch restore of files or folders. |
| recycleBinId | String | The Recycle Bin ID. |
| recycleItemId | String | The recycle item ID. |
| async | Boolean | Indicates whether the task is asynchronous. - true: Yes. - false: No. If the target object has child nodes, the task is processed asynchronously. |
| success | Boolean | Indicates whether the operation succeeded. - true: Success. - false: Failed. This field is not returned for asynchronous tasks. |
| errorCode | String | The error reason. This field is not returned for asynchronous tasks. |
| taskId | String | The asynchronous task ID, which can be used to query the task execution status. - For an internal app, call the Get asynchronous task information in storage API to query the task execution status. - For a third-party enterprise app, call the Get asynchronous task information in storage API to query the task execution status. |
| spaceId | String | The ID of the space where the restored file or folder is located. Returned for both synchronous and asynchronous tasks when the operation does not fail. |
| dentryId | String | The ID of the restored file or folder. Returned for both synchronous and asynchronous tasks when the operation does not fail. |
Response body example
Error codes
If an error occurs when calling this API, refer to the Global error codes documentation based on the error message for a solution.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | paramError | %s | Parameter error. |
| 400 | paramError.recycleBinId | %s | Parameter error - recycleBinId. |
| 400 | paramError.recycleItemIds | %s | Parameter error - recycleItemIds. |
| 400 | paramError.conflictStrategy | %s | Parameter error - conflictStrategy. |
| 403 | permissionDenied | %s | The user lacks management permission on the original file (folder) of the recycle item. |
| 404 | recycleBinNotExist | %s | The Recycle Bin does not exist. |
| 404 | recycleItemNotExist | %s | The recycle item does not exist. |
| 500 | systemError | %s | System error. |
| 500 | unknownError | Unknown Error | Unknown error. |
| 503 | operationTimeout | %s | Request timed out. |