Planfix API file.download: Difference between revisions

From Planfix
Jump to: navigation, search
(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...")
 
No edit summary
 
(3 intermediate revisions by 2 users 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 22: Line 23:
|-
|-
|}
|}
When calling the function, you can use either '''id''' or '''uniqueId'''. The presence of the '''id''' parameter excludes the use of the '''uniqueId''' parameter
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
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 37: Line 40:
|-
|-
|}
|}


Error response body:
Error response body:
Line 49: Line 53:
== Go To ==
== Go To ==
*[[Planfix API:Working with files]]
*[[Planfix API:Working with files]]
**[[Error codes XML API v1|Error codes]]
*[[Error codes XML API v1|Error codes]]
*[[List of functions]]
*[[List of functions]]

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>


Go To