Skip to main content

Trips

2 operations at https://api.zaitrack.app. Request and response bodies are JSON with camelCase keys; ids are UUIDs; times are RFC 3339 in UTC.

Every operation needs an API key, a personal access token or an OAuth access token unless it says otherwise. An Idempotency-Key is replayed for 24 hours; see Idempotency. Errors are application/problem+json; see Errors.

List trips​

GET /v1/trips

  • Scope: trips:read or trips:*
  • Rate class: read (100 per second and 360,000 per hour)
  • Idempotency-Key: not used
  • Audited: no
  • Step-up MFA: no
Query parameterTypeNotes
statusstring
pageSizestring
cursorstring
vehicleId—
driverId—
deviceId—
trailerId—
from—
to—

Request​

No body.

Response​

200: fields the handler writes, taken from its source.

FieldTypeNotes
itemsarray of object
items[].idstring
items[].deviceIdstring
items[].vehicleIdstringmay be null
items[].driverIdstringmay be null
items[].trailerIdstringmay be null
items[].statusstring
items[].startedAtstring
items[].endedAtstringmay be null
items[].startobjectmay be null
items[].start.latnumber
items[].start.lonnumber
items[].endobjectmay be null
items[].end.latnumber
items[].end.lonnumber
items[].distanceKmnumber
items[].durationSecinteger
items[].maxSpeedKphnumber
items[].avgSpeedKphnumber
items[].idleSecinteger
items[].overspeedEventsinteger
items[].harshBrakeEventsinteger
items[].harshAccelEventsinteger
items[].harshCornerEventsinteger
items[].endReasonstringomitted when empty
items[].odometerStartKmnumberomitted when empty
items[].odometerEndKmnumberomitted when empty
nextCursor—

Example​

curl "https://api.zaitrack.app/v1/trips" \
-H "Authorization: Bearer zk_test_…"

Get a trip​

GET /v1/trips/{id}

  • Scope: trips:read or trips:*
  • Rate class: read (100 per second and 360,000 per hour)
  • Idempotency-Key: not used
  • Audited: no
  • Step-up MFA: no

Path parameters: id.

Request​

No body.

Response​

200: fields the handler writes, taken from its source.

FieldTypeNotes
idstring
deviceIdstring
vehicleIdstringmay be null
driverIdstringmay be null
trailerIdstringmay be null
statusstring
startedAtstring
endedAtstringmay be null
startobjectmay be null
start.latnumber
start.lonnumber
endobjectmay be null
end.latnumber
end.lonnumber
distanceKmnumber
durationSecinteger
maxSpeedKphnumber
avgSpeedKphnumber
idleSecinteger
overspeedEventsinteger
harshBrakeEventsinteger
harshAccelEventsinteger
harshCornerEventsinteger
endReasonstringomitted when empty
odometerStartKmnumberomitted when empty
odometerEndKmnumberomitted when empty

Example​

curl "https://api.zaitrack.app/v1/trips/$ID" \
-H "Authorization: Bearer zk_test_…"