Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/storage/spaces/{spaceId}/dentries/batchRemove |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | permission-Storage.File.Write-Organization storage file write permission |
request header
| 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 an organization authorized by a third-party app API. |
path parameter
| Name | Type | Required | Description |
|---|---|---|---|
| spaceId | String | Yes | The space ID. Call the Add space API to obtain the value of the id parameter. |
query parameter
| Name | Type | Required | Description |
|---|---|---|---|
| unionId | String | Yes | The unionId of the operator. Call the Query user details API to obtain the value of the unionid parameter. |
request body
| Name | Type | Required | Description |
|---|---|---|---|
| dentryIds | Array of String | Yes | The list of file or folder IDs. A maximum of 50 IDs is allowed. Call the Get a list of files or folders or Get spaceId and dentryId by dentryUuid API to obtain the value of the id parameter. |
| option | Object | No | The optional parameters. |
| toRecycleBin | Boolean | No | Whether to move to the Recycle Bin. - true: Move to the Recycle Bin. - false (default): Do not move to the Recycle Bin; delete directly. |
Request example
HTTPResponse
response body
| Name | Type | Description |
|---|---|---|
| resultItems | Array | The list of batch deletion results. |
| spaceId | String | The space ID of the source file or folder. |
| dentryId | String | The ID of the source file or folder. |
| async | Boolean | Whether this is an asynchronous task. - true: Yes. - false: No. If the target object has child nodes, the operation is processed asynchronously. |
| success | Boolean | Whether the operation succeeded. - true: Succeeded. - false: Failed. This field is empty for asynchronous tasks. |
| errorCode | String | The error reason. This field is empty for asynchronous tasks. |
| taskId | String | The asynchronous task ID, which can be used to query the task execution status. |
Response body example
Error codes
If an error is returned when you call this API, look up the solution in the Global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | paramError | %s | Parameter error |
| 400 | operationConcurrentControl | %s | Concurrency control |
| 400 | paramError.spaceId | %s | Parameter error - spaceId |
| 400 | paramError.dentryIds | %s | Parameter error - dentryIds |
| 400 | recycleBinNotSupportForSpace | %s | The space does not support the Recycle Bin |
| 403 | permissionDenied | %s | The user does not have permission to delete the file or folder |
| 403 | operationNotSupported | %s | Moving to the Recycle Bin is not supported |
| 404 | spaceNotExist | %s | The space does not exist |
| 404 | dentryNotExist | %s | The file does not exist |
| 500 | systemError | %s | System error |
| 500 | unknownError | Unknown Error | Unknown error |
| 503 | operationTimeout | %s | Request timed out |