Legacy | Move file in Media Repository
Restriction: This information no longer refers to the latest product version but may still be relevant if you are working with an older version.
Moves a file in the media repository specified by the repository key. Used for renaming repository files.
Request syntax
Copy
https://mycloud.perfectomobile.com/services/repositories/media/<repositoryItemKey>?operation=move&securityToken=value&repositoryKey=value[&optionalParameter=value]
Important: All REST API commands require authentication. See the general authentication methods in Authentication and authorization.
Parameters
Name | Type | Default | Description |
---|---|---|---|
securityToken* | string |
|
A unique cryptographic key assigned to an authorized user. |
repositoryKey* | string |
|
The new repository key for the file. |
admin | boolean | false | true to allow users with administrative credentials to move items to or from the private repository of other automation users. |
owner | string |
|
The user name of the user who owns the item. This parameter is used in conjunction with the admin parameter to correctly identify items to be stored in or read from PRIVATE or GROUP repositories of the owner. For example, if a user with administrative credentials wants to move an item where the original repositoryItemKey is PRIVATE:myItem.jpg or GROUP:myItem.jpg, specify the parameters as admin=true and owner=itemUser. |
group | string |
|
The group name. This parameter is used in conjunction with the admin parameter to correctly identify items to be stored in or read from GROUP repositories. For example, if a user with administrative credentials wants to move an item where the repositoryItemKey isGROUP:myItem.jpg , specify the parameters as admin=true and group= groupName. |
property.<name> | boolean |
|
The name and value of one or more a repository properties of the new file, each prefixed with property. For example, to specify an integer property called readonly with the value true, add property.readonly=true to the URL. |
overwrite | boolean | false | true to overwrite existing files. |
responseFormat | string | json | Format of response: json, xml |
* Mandatory parameter
Response
Name | Description |
---|---|
errorMessage | Error description in case of failure. |
status | success if the operation completed successfully; otherwise failure. |
Example
This example shows the request for moving a file in the media repository specified by <repositoryItemKey> to a new key specified by repositoryKey without specifying any optional parameters.
Copy
Request
https://mycloud.perfectomobile.com/services/repositories/media/PRIVATE:Home-nexus.png?operation=move&securityToken=<your_token>&repositoryKey=PRIVATE:webshots/home.png
Copy
JSON response
{
"info":{
"creationTime":{
"formatted":"2016-12-06T06:55:12Z",
"millis":"1481007312946" },
"modelVersion":"2.22.0.0",
"productVersion":"master",
"time":"2016-12-06T06:55:12Z" },
"status":"Success"}