Request Formats
All requests must:
- Be sent using the HTTPS protocol as any request made to an unsecure HTTP address will return an error.
- Include an API Key and signature. (see "User Authentication" for more information)
Requests can:
- Specify a response format - if no extension or a ".json" is appended to the method name a JSON response will be returned. Append a ".xml" to the end of the method name in order to receive results formatted as XML.
Below is a general templates for request URLs:
https://<yoursubdomain>.filetransfers.net/api/<method_name><.json or .xml> <optional parameters for GET requests>
For example, to retrieve list all files in the path "/" sorted by oldest to newest in XML format, use the following URL:
https://<yoursubdomain>.filetransfers.net/api/file_list.xml?api_key=<your key> &path=/&sort_by=date_asc×tamp=<current time>&signature=<signature>
Response Formats
For the example above, a successful response in XML format would look like this:
<fileList> <path>/</path> <totalFiles>73</totalFiles> <filesInPage>50</filesInPage> <maxFilesPage>50</maxFilesPage> <files> <file> <id>1071256</id> <name>image1371675459160.jpg</name> <type>file</type> <size>706638</size> <formattedSize>690.08 KB</formattedSize> <path>/</path> <formattedModDate>6/19/13, 4:57 pm EDT</formattedModDate> <modDate>1371675460</modDate> <jobNumber>0</jobNumber> <workspaceId>0</workspaceId> <username>jsmith</username> <fileComments>3</fileComments> <scheduledDelete>0</scheduledDelete> <restricted>0</restricted> </file> </files> <userSettings> <admin>1</admin> <uploadFiles>1</uploadFiles> <batchUploadFiles>1</batchUploadFiles> <downloadFiles>1</downloadFiles> <batchDownloadFiles>1</batchDownloadFiles> <deleteFiles>1</deleteFiles> <batchDeleteFiles>1</batchDeleteFiles> <moveCopyFiles>1</moveCopyFiles> <batchMoveCopyFiles>1</batchMoveCopyFiles> <renameFiles>1</renameFiles> <createFolders>1</createFolders> <sendFiles>1</sendFiles> <sendFilesNonUser>1</sendFilesNonUser> <subAdmin>0</subAdmin> </userSettings> </fileList>
For the example above, an error response in XML format would look like this:
<error> <title>Authentication Failed</title> <message>Authentication parameters missing or invalid.</message> </error>
For the example above, a successful response in JSON format would look like this:
{"fileList": {"path":"\/","totalFiles":73,"filesInPage":50,"maxFilesPage":50,"files":[ {"id":1071256, "name":"image1371675459160.jpg", "type":"file", "size":706638, "formattedSize":"690.08 KB", "path":"\/", "formattedModDate":"6\/19\/13, 4:57 pm EDT", "modDate":1371675460, "jobNumber":"0", "workspaceId":0, "username":"jsmith", "fileComments":3, "scheduledDelete":0, "restricted":0} ], "userSettings":{"admin":1,"uploadFiles":1,"batchUploadFiles":1,"downloadFiles":1,"batchDownloadFiles":1, "deleteFiles":1,"batchDeleteFiles":1,"moveCopyFiles":1,"batchMoveCopyFiles":1,"renameFiles":1, "createFolders":1,"sendFiles":1,"sendFilesNonUser":1,"subAdmin":0} } }
For the example above, an error response in JSON format would look like this:
{"error":{"title":"Authentication Failed","message":"Authentication parameters missing or invalid."}}