Retrieve a File
Certain records may have files attached. For a purchase, you can request a compensation confirmation, for example. SQUAKE can send this via email; you can have it returned from the purchase request immediately or fetch the file from this endpoint later.
SQUAKE advises fetching files async after the purchase to keep the latency of the purchase API call low. You will always receive the file ID from the purchase endpoint if files are, or will be, attached to the record.
GET /v2/files/{id}
curl \
-X GET https://api.sandbox.squake.earth/v2/files/{id} \
-H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
# Headers
# Payload
{
"id": "file_asfg454s25",
"filename": "string",
"purpose": "confirmation_document",
"size": 42,
"type": "pdf",
"download_url": "https://example.com",
"notification": "string"
}
Response examples (401)
# Headers
SQUAKE-Request-Id: req_70394c00-728e-4d70-90bc-2b589c9ebdf8
# Payload
[
{
"code": "field_validation_error",
"detail": "string",
"source": {
"id": "string",
"attribute": "string",
"model": "string"
}
}
]
Response examples (404)
# Headers
SQUAKE-Request-Id: req_70394c00-728e-4d70-90bc-2b589c9ebdf8
# Payload
[
{
"code": "field_validation_error",
"detail": "string",
"source": {
"id": "string",
"attribute": "string",
"model": "string"
}
}
]