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.

Path parameters

  • id string Required

Responses

  • 200 application/json

    OK

    Hide headers attribute Show headers attribute
    • Unique identifier linked to this API request. If you need to contact us regarding a specific request, providing the request identifier helps the resolution process.

    Hide response attributes Show response attributes object
    • id string Required

      Format should match the following pattern: file_[A-Za-z0-9]*.

    • filename string Required
    • purpose string Required

      Values are confirmation_document, certificate_document, or project_image.

    • size integer Required

      Byte size of the object

    • type string Required

      Values are csv, jpg, pdf, png, or webp.

    • download_url string(uri)

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

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

  • 401 application/json

    Example response

    Hide headers attribute Show headers attribute
    • Unique identifier linked to this API request. If you need to contact us regarding a specific request, providing the request identifier helps the resolution process.

      Format should match the following pattern: req_[a-zA-Z0-9-]+.

    Hide response attributes Show response attributes object
    • code string Required

      An application-specific error code, expressed as a string value.

      Values are field_validation_error, server_error, not_authorized, not_found, invalid_methodology, or invalid_type.

    • detail string

      A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized.

    • source object

      An object containing references to the primary source of the error

      Additional properties are allowed.

      Hide source attributes Show source attributes object
  • 404 application/json

    Example response

    Hide headers attribute Show headers attribute
    • Unique identifier linked to this API request. If you need to contact us regarding a specific request, providing the request identifier helps the resolution process.

      Format should match the following pattern: req_[a-zA-Z0-9-]+.

    Hide response attributes Show response attributes object
    • code string Required

      An application-specific error code, expressed as a string value.

      Values are field_validation_error, server_error, not_authorized, not_found, invalid_methodology, or invalid_type.

    • detail string

      A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized.

    • source object

      An object containing references to the primary source of the error

      Additional properties are allowed.

      Hide source attributes Show source attributes object
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"
    }
  }
]