Planfix API file.download: Difference between revisions
From Planfix
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 12: | Line 12: | ||
</request> | </request> | ||
</source> | </source> | ||
{| class="wikitable" style="margin-top: 1em; width:100% " | {| class="wikitable" style="margin-top: 1em; width:100% " | ||
!width="150"|Name !!width="200"| Type !!width="50%"| Value !! Note | !width="150"|Name !!width="200"| Type !!width="50%"| Value !! Note | ||
|- | |- | ||
|file.id ||int ||file identifier || | |file.id ||int ||file identifier || | ||
Line 26: | Line 27: | ||
The result of the function is deciphered by the HTTP response code | The result of the function is deciphered by the HTTP response code | ||
{| class="wikitable" style="margin-top: 1em; width:100% " | {| class="wikitable" style="margin-top: 1em; width:100% " | ||
!Value !! Description !! Note | !Value !! Description !! Note | ||
Line 38: | Line 40: | ||
|- | |- | ||
|} | |} | ||
Error response body: | Error response body: |
Latest revision as of 08:36, 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>