Planfix API file.download: Difference between revisions
From Planfix
(Created page with "Function for downloading files. Request format: <source lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <request method="file.download"> <account></account> <sid></sid> <file> <id></id> <uniqueId></uniqueId> </file> <signature></signature> </request> </source> {| class="wikitable" style="margin-top: 1em; width:100% " !width="150"|Name !!width="200"| Type !!width="50%"| Value !! Note |- |file.id ||int ||file identifier || |- |file.uniqueId ||int ||uni...") |
(→Go To) |
||
Line 49: | Line 49: | ||
== Go To == | == Go To == | ||
*[[Planfix API:Working with files]] | *[[Planfix API:Working with files]] | ||
*[[Error codes XML API v1|Error codes]] | |||
*[[List of functions]] | *[[List of functions]] |
Revision as of 07:27, 12 March 2024
Function for downloading files. Request format:
<?xml version="1.0" encoding="UTF-8"?>
<request method="file.download">
<account></account>
<sid></sid>
<file>
<id></id>
<uniqueId></uniqueId>
</file>
<signature></signature>
</request>
Name | Type | Value | Note |
---|---|---|---|
file.id | int | file identifier | |
file.uniqueId | int | unique file identifier | |
signature | string(32) | signature |
When calling the function, you can use either id or uniqueId. The presence of the id parameter excludes the use of the uniqueId parameter
The result of the function is deciphered by the HTTP response code
Value | Description | Note |
---|---|---|
200 | response body - file | |
302 | direct link to the file is in the Location header | |
403 | access denied | response body - standard XML response with error decoding |
404 | such a file does not exist | response body - standard XML response with error decoding |
Error response body:
<?xml version="1.0" encoding="UTF-8"?>
<response status="error">
<code></code>
</response>