Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/storage/spaces/{spaceId}/dentries/{dentryId}/copy |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Permissions | permission-Storage.File.Write-Organization storage file write 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 an authorized organization for a third-party app API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| spaceId | String | Yes | The ID of the source space where the file or folder is located. Call the Add a space API to obtain the value of the id parameter. |
| dentryId | String | Yes | The ID of the file or folder to be copied. Call the Get a list of files or folders API or the Get spaceId and dentryId by dentryUuid API to obtain the value of the id parameter. |
Query parameters
| 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 a space API to obtain the value of the id parameter. |
| targetFolderId | String | Yes | The ID of the parent folder at the target location. Call the Get a list of files or folders API to obtain the value of the id parameter. |
| option | Object | No | Optional parameters. |
| conflictStrategy | String | No | The naming conflict strategy for files and folders: - AUTO_RENAME (default): Automatically rename. - 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 |
|---|---|---|
| dentry | Object | The list of file or folder information. |
| id | String | The file or folder ID. |
| spaceId | String | The ID of the space where the file or folder is located. |
| parentId | String | The parent folder ID. |
| type | String | The type: - FILE: File. - FOLDER: Folder. |
| name | String | The file or folder name. |
| size | Long | The file size, in bytes. This field is not returned for folders. |
| path | String | The path. |
| version | Long | The version. |
| status | String | The status: - NORMAL: Normal. - DELETED: Deleted. - EXPIRED: Expired. |
| extension | String | The file extension. This field is not returned for folders. |
| 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 attributes. |
| readOnly | Boolean | Whether the file or folder is read-only: - true: Yes. - false: No. |
| appProperties | Map<String, Array> | The attributes for specific apps. |
| Array | The attribute list. | |
| name | String | The attribute name. |
| value | String | The attribute value. |
| visibility | String | The attribute visibility: - PUBLIC: Publicly visible. - PRIVATE: Visible only to the current space. |
| uuid | String | The identifier field. |
| 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. |
| async | Boolean | Whether this is an asynchronous task: - true: Yes. - false: No. |
| taskId | String | The task ID, used to query the task execution status. |
Response body example
Error codes
If an error occurs when calling this API, 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.dentryId | %s | Parameter error - dentryId |
| 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 capacity |
| 400 | sceneQuotaInsufficient | %s | Insufficient scenario capacity |
| 400 | appQuotaInsufficient | %s | Insufficient app capacity |
| 400 | orgQuotaInsufficient | %s | Insufficient organization capacity |
| 400 | dentryAlreadyExist | %s | A file with the same name already exists |
| 403 | permissionDenied | %s | The user lacks permission to copy the file or folder |
| 404 | spaceNotExist | %s | The space where the source file/folder or target folder is located does not exist |
| 404 | dentryNotExist | %s | The source file/folder or target folder does not exist |
| 500 | systemError | %s | System error |
| 500 | unknownError | Unknown Error | Unknown error |
| 503 | operationTimeout | %s | Request timeout |