POST /api/v1/batch/{LibraryId}/{SpaceId}?copy&access_token={AccessToken}&user_id={UserId}
Request parameters. | Description | Type | Required or Not |
LibraryId | Media Library ID, obtained after creating a media library in the media hosting console. Please refer to create media library | String | Yes |
SpaceId | Space ID. If the media library is in single-tenant mode, this parameter is fixed as a hyphen (-); if the media library is in multi-tenant mode, you must specify this parameter. Please refer to create tenant space for retrieval. | String | Yes |
AccessToken | Access token, please refer to generate access token | String | Yes |
UserId | User ID, when the access token corresponds to administrator permissions and user identity recognition during token application is empty, is used to temporarily designate user identity. For details, see generate access token | String | No |
[{"copyFromSpaceId":"spaceNJsnjdiq","copyFrom": "bar","to": "foo/bar"},{"copyFrom": "foo/1.jpg","to": "bar/1.jpg"},{"copyFrom": "foo/2.jpg","to": "bar/2.jpg","conflictResolutionStrategy": "overwrite"}]
Request parameters. | Description | Type | Required or Not |
copyFrom | Source directory, album, or file path to be copied | String | Yes |
to | Destination directory, album, or file path | String | Yes |
conflictResolutionStrategy | Handling method when filename conflict ask: returns status 409 and error code SameNameDirectoryOrFileExists when conflicts with rename: rename the file when conflicts with overwrite: If the target is a directory or album, it defaults to ask and does not support overwrite If the target is a file, overwrite the existing file When an earlier version of the file exists in the target space, do not support moving and overwriting | String | No |
copyFromSpaceId | When copying across spaces, specify the space where the source directory or file resides. Do not specify this field when copying within the same space. | String | No |
-When projects are replicated asynchronously, return HTTP 202 Accepted. - When projects are replicated synchronously, return HTTP 200 OK (all execution successful) or HTTP 207 Multi-Status (part or all execution failed).
{"result": [{"status": 204,"copyFrom": "bar","to": [ "foo", "bar" ]},{"status": 200,"path": [ "bar", "1 (1).jpg" ],"copyFrom": [ "foo", "1.jpg" ],"to": [ "bar", "1.jpg" ]},{"status": 204,"copyFrom": [ "foo", "2.jpg" ],"to": [ "bar", "2.jpg" ]}]}
{ "taskId": 16 }
[{"taskId": 16,"status": 200,"result": [{"status": 204,"copyFrom": "bar","to": [ "foo", "bar" ]},{"status": 200,"path": [ "bar", "1 (1).jpg" ],"copyFrom": [ "foo", "1.jpg" ],"to": [ "bar", "1.jpg" ]},{"status": 204,"copyFrom": [ "foo", "2.jpg" ],"to": [ "bar", "2.jpg" ]}]}]
Response Parameters | Description | Type |
result.status | Copy result of individual item: 200: Copy successful when conflictResolutionStrategy is rename 204: Copy successful when conflictResolutionStrategy is ask or overwrite 403/404/409/500, copy failed | String |
result.path | The final path may not equal the specified path during replication because automatic renaming may exist here. | String Array |
result.copyFrom | The path passed in when making a request | String Array |
result.to | The corresponding path passed in when making a request | String Array |
Response Parameters | Description | Type |
status | Query task status 202: Task in progress 200: All executions successful 207: Part or all executions failed | String |
Feedback