Table of Contents


Download documents

Use this REST endpoint to download documents stored in your Magentrix org’s Document Library, record attachments, or Photo Gallery. The file is streamed back to the caller as binary data.

If you need document metadata—such as ID, name, or extension—use the query resource described [here].
 

curl GET 'https://{domain}/api/3.0/file/{record_id}'
  -H 'Content-Type: application/json'
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'

Request


record_id string Required

The unique ID of the file to be downloaded. The ID value can be the ID of a file in the Document Library, Entity record attachment, or photo gallery.

 

Successful Response

HTTP 200 OK

"SOME HEX CODE..."

 

Failed Response

HTTP 404 Not Found

{
    "message": "Record not found or unauthorized access.",
    "success": false
}


HTTP 400 Bad Request

{
    "message": "Invalid parameter: 'file ID'. A valid file ID must be provided.",
    "success": false
}