Copy File
post
/essbase/rest/v1/files/actions/copy
Copy a file from source to destination.
Request
Supported Media Types
- application/json
- application/xml
Query Parameters
-
overwrite: boolean
Overwrite existing file.
Default Value:false
File path details.
Response
Supported Media Types
- application/json
- application/xml
200 Response
OK
File copied successfully.
400 Response
Bad Request
Logged in user may not have appropriate permissions.
500 Response
Internal Server Error.
Examples
The following example shows how to copy a file from a source path to a destination path in the Essbase file catalog.
This example uses cURL to access the REST API from a Windows shell script. The calling user's ID and password are variables whose values are set in properties.bat
.
Script with cURL Command
call properties.bat
curl -X POST https://myserver.example.com:9001/essbase/rest/v1/files/actions/copy -H "Accept: application/json" -H "Content-Type:application/json" -d '{"from": "/users/ksmith/sample.zip" , "to": "/shared/sample.zip"}' -u %User%:%Password%
Example of Response Body
A response is returned only if there is an error. To avoid the particular error shown in this example, you can add the query parameter overwrite=true
.
{
"errorMessage" : "File with name 'sample.zip' already exists"
}