get_trip_locationstoken required
Returns the breadcrumb locations (lat/lon, speed, mileage, status) for a single trip / drive.
/api— body field action.name = "get_trip_locations"Parameters
| Name | Type | Required | Description |
|---|---|---|---|
drive_id | string | required | The drive/trip id to load locations for. On the wire this is the PG `trip.id` (small integer), not the legacy MSSQL `DRIVE_ID`. Grab one from a `get_vehicle_trips` response.e.g. 11821334 |
version | string | optional | API version selector (currently only v1). Accepted but ignored.e.g. 1 |
from_date | string | optional | Start of the location window (inclusive). Narrows the breadcrumb to part of the trip.e.g. 2026-08-24T08:00:00 |
to_date | string | optional | End of the location window (exclusive).e.g. 2026-08-24T09:00:00 |
Pagination
This action is paginated. The two parameters below are accepted on every call (both optional); omitting them yields page 1 with 100 rows. The response carries a pagination envelope alongside data; iterate while has_more === true.
page, page_size and has_more are present on every paginated response. total_count and total_pages are returned only by some actions — treat them as optional and drive iteration from has_more rather than from a page count worked out in advance.
| Name | Type | Required | Description |
|---|---|---|---|
page_number | number | optional | 1-based page index. Defaults to 1 if omitted. Page 1 pins a snapshot for stateful actions (events, telemetry) — subsequent pages reuse that snapshot until the session expires (~30 minutes).e.g. 1 |
page_size | number | optional | Rows per page. Defaults to 2000, which is also the maximum — larger values are silently capped to 2000, and a response of exactly 2000 rows usually means there are more pages. For stateful actions (events, telemetry) only the value sent with page 1 is honored, because later pages reuse the size pinned by the snapshot; stateless actions read it on every request.e.g. 2000 |
# Iterate every page until pagination.has_more is false.
# page_size "100" is a deliberate small page so the loop is visible — the
# default is 2000, which is also the maximum. Raise it to fetch fewer,
# larger pages; you still stop on has_more either way.
# Requires: jq (https://stedolan.github.io/jq/).
page=1
while :; do
body=$(curl -s -X POST 'https://private.stage.questar.io/v2/private-questar-units/api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{"action":{"name":"get_trip_locations","parameters":[{"drive_id":"11821334","version":"1","from_date":"2026-08-24T08:00:00","to_date":"2026-08-24T09:00:00","page_number":"'$page'","page_size":"100"}]}}')
echo "$body" | jq '.response.properties.data[]'
has_more=$(echo "$body" | jq -r '.response.properties.pagination.has_more // false')
[ "$has_more" = "true" ] || break
page=$((page + 1))
donePage 1 pins a snapshot for stateful actions (events, telemetry). If the session expires (~30 min) the API returns action_value="3" with description pagination_session_expired — restart from page_number=1.
Notes
Request
curl -X POST 'https://private.stage.questar.io/v2/private-questar-units/api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN' \
--data '{"action":{"name":"get_trip_locations","parameters":[{"drive_id":"11821334","version":"1","from_date":"2026-08-24T08:00:00","to_date":"2026-08-24T09:00:00"}]}}'{
"action": {
"name": "get_trip_locations",
"parameters": [
{
"drive_id": "11821334",
"version": "1",
"from_date": "2026-08-24T08:00:00",
"to_date": "2026-08-24T09:00:00"
}
]
}
}Response
Successful responses always wrap the action's payload in response.properties. The action_value field reports the handler outcome: "0" for success, "1" for invalid params, "2" for not allowed, "3" for limit-exceeded /pagination-session-expired, "999" for general error.
{
"response": {
"properties": {
"action_name": "get_trip_locations",
"action_value": "0",
"description": "success",
"data": [
{
"trip_id": "44321",
"vehicle_id": "555",
"license_number": "AB-123-CD",
"time": "2026-04-27T08:01:30",
"latitude": "32.0855120",
"longitude": "34.7820100",
"direction": "182",
"speed": "55.20",
"mileage": "152301.40",
"vehicle_status": "1"
}
],
"pagination": {
"page": 1,
"page_size": 100,
"has_more": true
}
}
}
}