Download a file

Files of file fields. Upload in three steps: start an upload, send the bytes to the returned URL, then write the file id into the file field with /v1/records/mutate or attach it with /v1/files/{id}/attach. To remove a file, write the field's list without its id with /v1/records/mutate. Access to a file follows read access to its record and field. Streams the file with its stored media type. PDFs and PNG, JPEG, GIF and WebP images open in the browser unless download is 1; every other type downloads. Supports a single byte range. Access is checked on every request, also for a signed downloadUrl.

Requires: read access to the record and the file field, or a valid download token

GET
/v1/files/{id}/content
x-api-key<token>

API key authentication. Create an API key in your user profile and include it in the x-api-key header.

In: header

Path Parameters

id*string

Id of the file.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Query Parameters

token?string

Signed token from an upload URL or a downloadUrl; replaces the API key for this one file for 15 minutes.

Lengthlength <= 512
download?string

1 always downloads the file instead of showing it.

Value in"1"

Header Parameters

range?string

A single byte range such as bytes=0-1023.

Response Body

application/octet-stream

application/octet-stream

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://customermates.com/api/v1/files/497f6eca-6276-4993-bfeb-53cbbbba6f08/content"
"string"
"string"
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
Empty
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
Empty