Tuyu Developers

Developers

Customize the URLs on this site with your Tuyu URL:

https:// .
Method Documentation > Files and Folders

File Move POST

Description

Moves a file or folder to a new location.

URL

All responses are in JSON format by default, to specify an XML response add “.xml” to the end of the method name (in this case “file_move”)

https://<your subdomain>.<your domain>/api/file_move

Restrictions

The calling user must have:

  • Access to the file's original location.
  • Access to the location the file is being moved to.
  • Move permissions in the file's original location.

Parameters

Bold indicates required

Parameter Description
api_key Your API Key.
destination_path Location where file will be moved to. This value should be URL-encoded. All paths must begin and end with “/”, with the exception of admins uploading into the site root, in which the path is simply “/”. Specific paths can be retrieved from file_list.
file_id The ID of the file or folder to be moved. IDs can be retrieved from file_list.
overwrite Default is 0, which will not overwrite a file with the same name in the destination location and return an error if a file with same name is found. If value equals 1 any file with the same name in the destination location will be overwritten with this file.
timestamp The current time in Unix timestamp format.
signature Please see “User Authentication” for more information.

Sample Response

Successful response In JSON:

{"fileInfo":{"fileId":1071266,"path":"\/","fileName":"recording.aiff","workspaceName":"Developers"}}

Successful response in XML:

<fileInfo>
    <fileId>1071267</fileId>
    <path>/</path>
    <fileName>image.png</fileName>
    <workspaceName>Developers</fileName>
</fileInfo>

Error response In JSON:

{"error":{
    "title":"You do not have access privileges for this location",
    "message":"Please try a different location or speak to an administrator."}
}

Error response In XML:

<error>
    <title>You do not have access privileges for this location</title>
    <message>Please try a different location or speak to an administrator.</message>
</error>