Copy a file
To copy a file, send a request with a id path parameter for the file to copy that defines the location and name of the copy.
Filesets cannot be copied.
To copy a file:
- API CALL:
POST {base URL}/api/files/{id}/copy—OR—
POST {base URL}/api/files/copy?path={file_path}-
HEADERS:
- Accept: application/json
Note: This may be automatically added by your development tool. Postman and curl add this header to all requests.
- Content-Type: application/json
- Authorization: Bearer {bearer token}Include Trimble Identity OAuth Bearer token for your application.
-
BODY: Base your body on the Example Request code sample below. The path attribute is required.
Until the copied file successfully gets replicated to all of the regions specified (or their values copied from src), two things happen:
The copied file will show a FINALIZING status.
A lock will be placed onto the source and the copied file. This lock will prevent both the files from being deleted until the copy operation succeeds including the internal replication.
After the copy operation is complete, the file status value will be AVAILABLE.
Reference Materials