Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/storage/spaces/{spaceId}/dentries/batchMove |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Permissions required | 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 that authorizes a third-party app API. |
Path parameter
| Name | Type | Required | Description |
|---|---|---|---|
| spaceId | String | Yes | The ID of the space where the source files or folders reside. 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 |
|---|---|---|---|
| targetSpaceId | String | Yes | The ID of the target space. Call the Add space API to obtain the value of the id parameter. |
| targetFolderId | String | Yes | The ID of the target folder. The ID of the root directory is 0. Call the Get a list of files or folders API to obtain the value. |
| dentryIds | Array of String | Yes | The list of IDs of the source files or folders. Up to 30 items are supported. 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 | Optional parameters. |
| conflictStrategy | String | No | The name conflict strategy for files or folders. - 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. |
| preservePermissions | Boolean | No | Whether to preserve permissions after the move. - true: preserve. - false (default): do not preserve. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| resultItems | Array | The result list of the batch move of files or folders. |
| spaceId | String | The ID of the space where the source files or folders reside. |
| dentryId | String | The ID of the source file or folder. |
| async | Boolean | Whether the task is asynchronous. - true: yes. - false: no. If the operated object has child nodes, the task is processed asynchronously. |
| success | Boolean | Whether the operation succeeded. - true: succeeded. - 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 ID of the asynchronous task. Use it to query the task execution status. |
| targetSpaceId | String | The ID of the space the item belongs to after the move. Returned for both synchronous and asynchronous tasks, except when the operation fails. |
| targetDentryId | String | The ID of the file or folder after the move. Returned for both synchronous and asynchronous tasks, except when the operation fails. |
Response body example
Error codes
If an error is returned when this API is called, refer to the Global error codes document to find a solution based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | operationConcurrentControl | %s | Concurrency control. |
| 400 | paramError | %s | Parameter error. |
| 400 | paramError.spaceId | %s | Parameter error - spaceId. |
| 400 | paramError.dentryIds | %s | Parameter error - dentryIds. |
| 400 | paramError.targetSpaceId | %s | Parameter error - targetSpaceId. |
| 400 | paramError.targetFolderId | %s | Parameter error - targetFolderId. |
| 400 | paramError.conflictStrategy | %s | Parameter error - conflictStrategy. |
| 400 | spaceQuotaInsufficient | %s | Insufficient space quota. |
| 400 | sceneQuotaInsufficient | %s | Insufficient scene quota. |
| 400 | appQuotaInsufficient | %s | Insufficient app quota. |
| 400 | orgQuotaInsufficient | %s | Insufficient organization quota. |
| 400 | dentryAlreadyExist | %s | A file with the same name already exists. |
| 403 | permissionDenied | %s | The user lacks permission to move the file (or folder). |
| 404 | spaceNotExist | %s | The space where the source file (or folder) or target directory resides does not exist. |
| 404 | dentryNotExist | %s | The source file (or folder) or target directory does not exist. |
| 500 | systemError | %s | System error. |
| 500 | unknownError | Unknown Error | Unknown error. |
| 503 | operationTimeout | %s | Request timed out. |