How To Use The Rest API End Point - File Download
Use this end-point to download files from existing Attachment records or from records that have an
Attachment field. Only 1 file at a time can be downloaded per request.
GET Type End-Point
/api/v1/collect/app/download
Parameters
The following parameters are supported. The header must still be set with the applicable access
token and x-collect-database value, even if you set the file download to open in a new tab.
- record: {table name}
- rowid: {rowid}
- field (optional): {field name where file name is stored}
Supported Records:
Field is an optional parameter. If a field is not specified, then the default Attachment field
is used. For records like Transactions or Contacts, there is only 1 Attachment field, so the field
parameter is ignored. For Debtor Attachments and Client Attachments, there are 4 fields for files.
The default is the first one and the remaining ones can be specified using the below options.
Supported Optional Fields for: attachment
- at_file_2
- at_file_3
- at_file_4
Supported Optional Fields for: cl_attachment
- cl_at_file_2
- cl_at_file_3
- cl_at_file_4
Examples
/api/v1/collect/app/download?record=contact&rowid=123
/api/v1/collect/app/download?record=de_transaction&rowid=123
/api/v1/collect/app/download?record=attachment&rowid=123
/api/v1/collect/app/download?record=attachment&rowid=123&field=at_file_2
/api/v1/collect/app/download?record=cl_attachment&rowid=123
/api/v1/collect/app/download?record=cl_attachment&rowid=123&field=cl_at_file_2
Response Body
The response will include a status value. 200 is good. Everything else is a failure. If the response
is good, then the response will include the file for downloading.
|
Was this page helpful? Do you have any comments on this document? Can we make it better? If so how may we improve this page.
Please click this link to send us your comments: helpinfo@collect.org