Tuyu Developers

Developers

Customize the URLs on this site with your Tuyu URL:

https:// .
Method Documentation > Files and Folders

Create File Link POST

Description

Creates a publicly-accesible link that can be set to expire in 15 days or less (or never expire).

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

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

Restrictions

The calling user must have:

  • Access to the file's location.
  • Send permissions in the file's location.

Parameters

Bold indicates required

Parameter Description
api_key Your API Key.
file_id The ID of the file being linked. IDs can be retrieved from file_list.
link_expiration Default is 15 days for the link to expire. The allowed options are 90, 60, 30, 15 through 1, and 0. Use 0 to allow the link to never expire. Please note: link expiration does not mean the file will expire, only that the link to the file will no longer work after the entered number of days.
timestamp The current time in Unix timestamp format.
signature Please see “User Authentication” for more information.

Sample Response

Successful response In JSON:

{"fileCreateLink":{"fileId":1071266,"fileName":"recording.aiff", "downloadLink": "https://<your subdomain>.<your domain>/downloadPublic/123456578901203303"}}

Successful response in XML:

<fileCreateLink>
    <fileId>1071267</fileId>
    <fileName>recording.aiff</fileName>
    <downloadLink>https://{{ siteInfo.subdomain }}.{{ siteInfo.domain }}/downloadPublic/123456578901203303</downloadLink>
</fileCreateLink>

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>