Beezr API

Read the metadata

query returns data as an array and meta with four fields. meta appears only on query responses.

FieldMeaning
totalRecords that match
limitPage limit
offsetPage offset
returnedRecords in this page

limit defaults to 20 and is clamped to 1–100. offset defaults to 0 and is never negative. There are more pages while offset + returned < total. Advance by returned, not by a guessed page size.

Loop through pages

These loops stop if the call fails or returns an empty page. Use rate-limit handling around each call in a running integration. Keep at most 2 calls in flight.

# This shell loop uses Python to read JSON metadata.
offset=0
while true; do
  body=$(printf '{"module":"cm_equipment_requests_base","fields":["title"],"limit":100,"offset":%s}' "$offset")
  response=$(curl --fail-with-body --silent --show-error \
    "https://services.beezr.io/generic/api/v4/records/query" \
    -H "X-API-Key: $BEEZR_API_KEY" -H "Content-Type: application/json" \
    --data "$body") || break
  printf '%s\n' "$response"
  next=$(printf '%s' "$response" | python -c 'import json,sys; r=json.load(sys.stdin); m=r["meta"]; print(m["offset"]+m["returned"] if r["success"] and m["returned"] and m["offset"]+m["returned"]<m["total"] else -1)') || break
  [ "$next" -lt 0 ] && break
  offset=$next
done

Keep exports small

Use fields to request only what you need. id always comes back. File fields in v4 are references, so a query doesn't include file bytes. Download files separately with Download a file.

The export guide puts these steps together.