Retrieve a File

GET
/v2/files/{id}

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.

Authorization

Bearer-Auth
headerAuthorizationBearer <token>

Path Parameters

id*string

Response Body

OK

application/json
  1. response
id*string
Matchfile_[A-Za-z0-9]*
filename*string
purpose*string
Value in"confirmation_document""certificate_document""project_image"
size*integer

Byte size of the object

type*string
Value in"csv""jpg""pdf""png""webp"
download_url?string

The link will expire after 1 year. If blank, the document has not been created yet. Please poll until a link is included.

Formaturi
notification?string

Information pertaining to the file, e.g., when the file will be available

Example Request
curl -X GET 'https://api.sandbox.squake.earth/v2/files/string'
Example Response
{  "id": "file_asfg454s25",  "filename": "string",  "purpose": "confirmation_document",  "size": 0,  "type": "pdf",  "download_url": "http://example.com",  "notification": "string"}