Tuyu Developers

Developers

Customize the URLs on this site with your Tuyu URL:

https:// .
Method Documentation > Files and Folders

File Rename POST

Description

Renames a file or folder. If a file or folder with the same name already exists an error will be returned.

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_rename”)

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

Restrictions

The calling user must have:

  • Access to the file's location.
  • Rename permissions in the file upload location.

Parameters

Bold indicates required

Parameter Description
api_key Your API Key.
file_id The ID of the file or folder to be renamed. IDs can be retrieved from file_list.
new_name The name replacing the current file or folder name. Names with illegal characters will be filtered out.
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":"Designers"}}

Successful response in XML:

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

Error response In JSON:

{"error":{
    "title":"Please enter a file name that does not already exist.",
    "message":"The name you entered already exists, please choose a new name."}
}

Error response In XML:

<error>
    <title>Please enter a file name that does not already exist.</title>
    <message>The name you entered already exists, please choose a new name.</message>
</error>