Tuyu Developers

Developers

Customize the URLs on this site with your Tuyu URL:

https:// .
Method Documentation > Files and Folders

File Download GET

Description

Downloads a file based on a file_id.

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

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

Restrictions

The calling user must have:

  • Access to the location the file resides in
  • Download permissions in the location the file resides in

Parameters

Bold indicates required

Parameter Description
api_key Your API Key.
file_id The ID of a file being downloaded. This value can be retrieved from file_list.
timestamp The current time in Unix timestamp format.
signature Please see “User Authentication” for more information.

Sample Response

Download, unlike other calls, returns only raw file data along with headers containing the file name (“Content-Disposition” or “File-Name”) in a successful response. If called from a browser, for example, the browser will prompt to save the file or automatically display depending on your settings. If called from the command-line you will need to make provisions to handle this data. Please see Examples for more information.

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>