Skip to content

Developers

Documents

Download platform documents by id.

GET /documents/{id}/download

Download a document by id

Returns the original file bytes for a platform document (permanent URL). The document must belong to your account.

Required permission: documents:files.read (Documents › Files › Read)

Pagination: Not paginated: returns the full set.

Parameters

NameInTypeDescription
idrequiredpathstring

Responses

200 The document file · application/octet-stream

401 Missing or invalid Bearer token. · application/json

NameTypeDescription
errorstringHuman-readable error message
required_permissionstringPresent on 403 - the missing permission (area:resource.action)

403 Token lacks the required permission, or the resource is outside the token's tenant. · application/json

NameTypeDescription
errorstringHuman-readable error message
required_permissionstringPresent on 403 - the missing permission (area:resource.action)

404 Resource not found (or belongs to a different tenant). · application/json

NameTypeDescription
errorstringHuman-readable error message
required_permissionstringPresent on 403 - the missing permission (area:resource.action)

429 Rate limit exceeded. · application/json

NameTypeDescription
errorstringHuman-readable error message
required_permissionstringPresent on 403 - the missing permission (area:resource.action)

Examples

curl
curl -X GET "https://app.bm.consulting/api/v1/documents/<id>/download" \
  -H "Authorization: Bearer $BMC_TOKEN" \
  -o fichero
TypeScript (fetch)
const res = await fetch("https://app.bm.consulting/api/v1/documents/<id>/download", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.BMC_TOKEN}`,
  },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const file = Buffer.from(await res.arrayBuffer());
Python (requests)
import os
import requests

res = requests.get(
    "https://app.bm.consulting/api/v1/documents/<id>/download",
    headers={"Authorization": f"Bearer {os.environ['BMC_TOKEN']}"},
    timeout=30,
)
res.raise_for_status()
contenido = res.content
Email
Contact