Copy File

post

/files/actions/copy

Copies a file from source to destination.

Request

Query Parameters
Back to Top

Response

200 Response

OK

File copied successfully.

400 Response

Bad Request

Logged in user may not have appropriate permissions.

500 Response

Internal Server Error.

Back to Top

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"
}
Back to Top