Copies a file or folder.
Debugging
Authorization information
Request syntax
POST /v2/file/copy HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| body | object | No | The request parameters. | |
| share_id | string | No | The share ID. If you want to manage a file by using a share link, carry the | |
| drive_id | string | No | The drive ID. | 1 |
| file_id | string | Yes | The file ID or folder ID. | 4221bf6e6ab43c255edc4463bf3a6f5f5d317406 |
| to_drive_id | string | No | The ID of the drive to which you want to copy the file or folder. Default value: the value of drive_id. | 1 |
| to_parent_file_id | string | Yes | The ID of the destination parent folder. If you want to copy the file or folder to a root directory, set this parameter to root. | 6520943DC261 |
| auto_rename | boolean | No | Specifies whether to automatically rename the file if the file name already exists in the destination folder. Default value: false. | true |
Response parameters
Examples
Sample success responses
JSONformat
{
"domain_id": "bj1",
"drive_id": 1,
"file_id": "4221bf6e6ab43a255edc4463bffa6f5f5d317401",
"async_task_id": "000e89fb-cf8f-11e9-8ab4-b6e980803a3b"
}Error codes
For a list of error codes, visit the Service error codes.
