Trips/get_vehicle_trips_extended

get_vehicle_trips_extendedtoken required

Returns enriched trip rows (fuel, idle, DOA, safety, geocoded start/end) for one or more vehicles or a driver.

POST/api— body field action.name = "get_vehicle_trips_extended"

Parameters

NameTypeRequiredDescription
vehicle_idstringoptionalSingle id, or a comma-separated list of up to 100 vehicle ids.e.g. 555,556,557
license_numberstringoptionalLicense plate filter. Aliases: `license_nmbr`, `License_NMBR`. Resolved to a single vehicle id.e.g. AB-123-CD
driver_idnumberoptionalDriver id. Required if no vehicle filter is supplied.e.g. 789
from_datedateoptionalStart of the date range (YYYY-MM-DD). Must be set together with `to_date`. Defaults to today.e.g. 2026-04-01
to_datedateoptionalEnd of the date range (YYYY-MM-DD). Inclusive. Range cannot exceed 32 days.e.g. 2026-04-27
drive_idnumberoptionalReturn a single trip by id instead of a date range.e.g. 11821334

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.

NameTypeRequiredDescription
page_numbernumberoptional1-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_sizenumberoptionalRows 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
curl
# 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_vehicle_trips_extended","parameters":[{"vehicle_id":"555,556,557","license_number":"AB-123-CD","driver_id":789,"from_date":"2026-04-01","to_date":"2026-04-27","drive_id":11821334,"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))
done

Page 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

env_id is taken from the session only — no parameter override. Provide one or more of `vehicle_id` / `license_number` / `driver_id`. Up to 100 vehicle ids per call. License aliases `license_nmbr`/`License_NMBR` accepted. `from_date` and `to_date` must both be set or both omitted; when both are omitted the window defaults to today only (single UTC day). Range > 32 days returns action_value '1'. Locations are reverse-geocoded via Google Maps; geocoding failures return empty strings rather than failing the request.

Request

curl
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_vehicle_trips_extended","parameters":[{"vehicle_id":"555,556,557","license_number":"AB-123-CD","driver_id":789,"from_date":"2026-04-01","to_date":"2026-04-27","drive_id":11821334}]}}'
Body
{
  "action": {
    "name": "get_vehicle_trips_extended",
    "parameters": [
      {
        "vehicle_id": "555,556,557",
        "license_number": "AB-123-CD",
        "driver_id": 789,
        "from_date": "2026-04-01",
        "to_date": "2026-04-27",
        "drive_id": 11821334
      }
    ]
  }
}

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.

200 OK
{
  "response": {
    "properties": {
      "action_name": "get_vehicle_trips_extended",
      "action_value": "0",
      "description": "success",
      "data": [
        {
          "drive_id": "44321",
          "vehicle_id": "555",
          "license_number": "AB-123-CD",
          "vehicle_group": "Tel Aviv Fleet",
          "parent_group": "",
          "upper_group": "",
          "top_group": "",
          "driver_name": "John Doe",
          "driver_code": "DRV-789",
          "driver_group": "",
          "worker_id": "W-789",
          "start_latitude": "32.0853000",
          "start_longitude": "34.7818000",
          "start_mileage": "152300.10",
          "end_latitude": "32.1093000",
          "end_longitude": "34.8555000",
          "distance": "12.45",
          "drive_duration": "00:23:11",
          "start_fuel_level_percent": "82.00",
          "end_fuel_level_percent": "78.00",
          "fuel_used": "1.40",
          "idle_time": "00:01:30",
          "total_mileage": "152312.55",
          "doa_dist": "0.00",
          "doa_dist_percent": "",
          "doa_time": "0",
          "doa_time_percent": "",
          "engine_hours": "0.39",
          "water_used": "0.00000",
          "driver_id": "789",
          "start_time": "2026-04-27T08:00:00Z",
          "end_time": "2026-04-27T08:23:11Z",
          "start_location": "Rothschild Blvd, Tel Aviv",
          "end_location": "Hayarkon St, Tel Aviv",
          "chassis_serial": "",
          "liter_Per_100_km": "11.24",
          "time_from_prev_drive": "00:14:00",
          "km_per_1_Liter": "8.89",
          "safety_score": "95",
          "main_driver": "",
          "main_driver_name": "",
          "main_driver_code": "",
          "energy_type": "",
          "CO2": "",
          "avg_speed": "32.218",
          "trailer": ""
        }
      ],
      "pagination": {
        "page": 1,
        "page_size": 100,
        "has_more": true
      }
    }
  }
}