Tuyu Developers

Developers

Customize the URLs on this site with your Tuyu URL:

https:// .
Method Documentation > Files and Folders

Create Folder POST

Description

Creates a new folder in the specified 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 “create_folder”)

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

Restrictions

The calling user must have:

  • Access to the specified location.
  • Create folders permissions in the specified location.

Parameters

Bold indicates required

Parameter Description
api_key Your API Key.
folder_name The name of the folder to be created.
folder_path The location where the folder will be created. All paths must begin and end with “/”, with the exception of admins uploading into the site root, in which the path is simply “/”. Paths can be retrieved from file_list.
timestamp The current time in Unix timestamp format.
signature Please see “User Authentication” for more information.

Sample Response

Successful response In JSON:

{"createFolder":{
    "folder_id":1071266,
    "folder_name":"for_review",
    "folder_path":"\/Designers_workspace\/",
    "workspace_id":"4754"}
}

Successful response in XML:

<createFolder>
    <folder_id>1071267</folder_id>
    <folder_name>for_review</folder_name>
    <folder_path>/Designers_workspace/</folder_path>
    <workspace_id>4754</workspace_id>
</createFolder>

Error response In JSON:

{"error":{
    "title":"Cannot create folder",
    "message":"Please try a different location or speak to an administrator."}
}

Error response In XML:

<error>
    <title>Cannot create folder</title>
    <message>Please try a different location or speak to an administrator.</message>
</error>