Document - Download
Purpose
To retrieve a single-use, signed S3 url (with 30 second max expiration) from which the binary file of a Document resource may be downloaded to be stored on your internal file system.
Request
Endpoint
GET /document/download
Authentication
Include your API Key within the x-api-key header as described here.
Parameters
The following table lists the parameters that this query supports. All of the parameters listed are query parameters.
| Parameter | Type | Definition |
|---|---|---|
| id | integer | The unique ID for this document in the Incentify system. |
| internal_id | string | The unique ID for this document in your internal system. |
Request Body
Do not provide a request body when calling this method.
Successful Response
If successful, this method returns an http code of 200 and response body with the following structure:
Response Body
{
"code":200,
"success":true,
"data": {
"url": "https://s3.amazonaws.com/xxxx-xxxxx-xxxx-bucket/xxxx/tax-certificate.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3SGQVQG7FGA6KKA6%2F20221104%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221104T140227Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=b228dbec8c1008c80c162e1210e4503dceead1e4d4751b4d9787314fd6da4d55"
},
"errors": []
}
Error Response
If the request has invalid fields/values, this method returns an http code of 400 and response body with the following structure:
Error Response Body
{
"code":400,
"success":false,
"data": {},
"errors": [
"text describing error here"
]
}
Properties
The following table defines the properties that appear in this resource:
| Key | Type | Definition |
|---|---|---|
| code | integer | HTTP Status Code (ie; 200, 403, etc). |
| success | boolean | Either true (success) or false (fail). |
| data.url | string | Signed S3 URL to download the associated file with. |
| errors | [string, string, string...] | If the request fails, this will contain information about the error. |