Tuyu Developers

Developers

Customize the URLs on this site with your Tuyu URL:

https:// .
Method Documentation > Files and Folders

File Send POST

Description

Sends a file, folder, or collection of files and folders.

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

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

Restrictions

The calling user must have:

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

Parameters

Bold indicates required, * indicates required if sending more than one file to 3 or more non-user email addresses.

Parameter Description
api_key Your API Key.
download_receipt Default is 0, 1 means the sender will receive an email notification the first time each recipient downloads the file.
file_id The ID of the file or folder being sent. Send multiple files/folders by using a comma-separated list. File IDs can be retrieved from file_list. NOTE: All files must reside in the same workspace.
file_preparation_id * If sending two or more files or one or more folders to 3 or more non-user email addresses you must first call send_files_prep and retrieve the file preparation ID sent in the response. You can then pass that ID into this parameter.
link_expiration Default (and maximum allowed valued) is 15 days for links in the notification to expire. Please note that link expiration does not mean the file will expire, only that the link in the notification will no longer work after the entered number of days. Use 0 for the notification link never to expire.
message An optional message to be included in the notification email
non_users Comma-separated list of non-user email addresses. If the sender does not have permissions to send files to non-users in the location of the file they are sending this field will be nullified.
require_login Default is 0, 1 means recipients will be forced to log in in order to download the file. Any values set in non_users will be nullified if this value is set to 1.
subject An optional subject for the notification email
timestamp The current time in Unix timestamp format.
user_group_ids The ID of the user group being sent the files. Send to multiple user groups by using a comma-separated list. User group IDs can be retrieved from users_location_access. Invalid user group IDs (IDs that do not have permissions to all of the files will be ignored.
user_ids The ID of the user being sent the files. Send to multiple users by using a comma-separated list. User IDs can be retrieved from users_location_access. Invalid user IDs (IDs that do not exist on the site or do not have permissions to all of the files will be ignored.
signature Please see “User Authentication” for more information.

Sample Response

Successful response In JSON:

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

Successful response in XML:

<fileInfo>
    <fileId>1071267</fileId>
    <path>/</path>
    <fileName>image.png</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>