Copy a File Between Instances (v1)

REST Resource

POST /interop/rest/v1/services/copyfile

Request

Supported Media Types: application/x-www-form-urlencoded

Table 2-170 Parameters

Name Description Type Required Default
sourceFileName Name of the file to be copied Form Yes None
userName User with access to the source instance Form Yes None
pwd Base64-encoded password Form Yes None
sourceURL The URL of the source instance Form Yes None
targetFileName Name of the file to be copied to the target environment Form Yes None

Sample Request Payload

{
  "sourceFileName": "<FILE-NAME>",
  "userName": "<USER_NAME>",
  "pwd": "<PASSWORD>",
  "sourceURL": "<SOURCE-URL>",
  "targetFileName": "<TARGET-FILENAME>"
}

Response

Supported Media Types: application/json

Table 2-171 Parameters

Name Description
details In the case of errors, details are published with the error string
status See Migration Status Codes
links Detailed information about the link
href Links to API call or status API
action The HTTP call type
rel Possible values: self or Job Status. If the value is set to Job Status, you can use the href to get the status
data Parameters as key value pairs passed in the request

Example of Response Body

{
  "details": null,
  "status": -1,
  "items": null,
  "links": [
    {
      "href": "https://<BASE-URL>/interop/rest/v1/services/copyfile",
      "action": "POST",
      "rel": "self",
      "data": null
    },
    {
      "href": "https://<BASE-URL>/interop/rest/v1/services/jobs/<JOB_ID>",
      "action": "GET",
      "rel": "Job' 'Status",
      "data": null
    }
  ]
}

Sample cURL Command

curl -s -u <USERNAME>:<PASSWORD> -H 'Content-Type: application/x-www-form-urlencoded' --request POST https://<BASE-URL>/interop/rest/v1/services/copyfile -d 'sourceFileName=<FILE-NAME>&userName=<USERNAME>&pwd=<PASSWORD>&sourceURL=<SOURCE-URL>&targetFileName=<TARGET-FILENAME>'