Admin/Lookup/get_user_drivers

get_user_driverstoken required

Returns drivers that the authenticated user is allowed to see, optionally filtered by driver or group id.

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

Parameters

NameTypeRequiredDescription
driver_idnumberoptionalDriver id (positive integer).e.g. 10494
group_idnumberoptionalGroup id (positive integer).e.g. 1005
active_driversnumberoptionalWhich drivers to include: 0 = inactive only, 1 = active only, 2 = both. Defaults to 1, so an unfiltered call returns ACTIVE DRIVERS ONLY — pass 2 to match a legacy count that includes inactive drivers.e.g. 2
from_datestringoptionalStart of the activity window (inclusive). Pair with to_date; supplying only one is rejected.e.g. 2026-08-01T00:00:00
to_datestringoptionalEnd of the activity window (exclusive). Pair with from_date.e.g. 2026-08-24T00:00:00
modestringoptionalDriver-efficiency ranking: "most" or "least". Adds the four efficiency fields to each row and orders by score. Requires a date window.e.g. most
start_datestringoptionalAlias for from_date, accepted only when mode is set.e.g. 2026-08-01T00:00:00
end_datestringoptionalAlias for to_date, accepted only when mode is set.e.g. 2026-08-24T00: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.

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.develop-1.questar.io/v2/private-questar-units/api' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -d '{"action":{"name":"get_user_drivers","parameters":[{"driver_id":10494,"group_id":1005,"active_drivers":2,"from_date":"2026-08-01T00:00:00","to_date":"2026-08-24T00:00:00","mode":"most","start_date":"2026-08-01T00:00:00","end_date":"2026-08-24T00: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))
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

active_drivers defaults to 1 (active only), so an unfiltered call does not return inactive drivers — pass 2 to match a legacy count. The four efficiency fields (driving_hours, safety_events, mechanical_events, normalized_to_100) are returned only when `mode` is set. `last_event_direction` is the vehicle heading in degrees (0-359) at the driver's last event. Legacy spellings `license_nmbr` / `License_NMBR` are accepted wherever `license_number` is. Field population, measured against a live Mexico account: `client_group`, `driver_id`, `driver_name`, `driver_code` and `active_flag` are fully populated; `group_name`, `parent_group`, `parent_group_name`, `contact_person_phone_number` and `last_event_licence_number` resolve from a cached lookup and were empty when measured on 2026-08-19; `worker_id`, `driver_cell_phone` and the `last_event_*` group are populated for only some drivers — a driver that has never generated an event has no last-event data. Plan for these as optional rather than assuming parity with the legacy driver list.

Request

curl
curl -X POST 'https://private.develop-1.questar.io/v2/private-questar-units/api' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  --data '{"action":{"name":"get_user_drivers","parameters":[{"driver_id":10494,"group_id":1005,"active_drivers":2,"from_date":"2026-08-01T00:00:00","to_date":"2026-08-24T00:00:00","mode":"most","start_date":"2026-08-01T00:00:00","end_date":"2026-08-24T00:00:00"}]}}'
Body
{
  "action": {
    "name": "get_user_drivers",
    "parameters": [
      {
        "driver_id": 10494,
        "group_id": 1005,
        "active_drivers": 2,
        "from_date": "2026-08-01T00:00:00",
        "to_date": "2026-08-24T00:00:00",
        "mode": "most",
        "start_date": "2026-08-01T00:00:00",
        "end_date": "2026-08-24T00: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.

200 OK
{
  "response": {
    "properties": {
      "action_name": "get_user_drivers",
      "action_value": "0",
      "description": "success",
      "data": [
        {
          "driver_id": "789",
          "worker_id": "W-789",
          "driver_name": "John Doe",
          "active_flag": "",
          "driver_code": "",
          "client_group": "10",
          "group_name": "Tel Aviv Fleet",
          "parent_group": "",
          "parent_group_name": "",
          "driver_cell_phone": "",
          "customer_contact_person": "",
          "contact_person_phone_number": "",
          "driver_email": "",
          "last_event_id": "",
          "last_event_time": "",
          "last_event_type": "",
          "last_event_type_desc": "",
          "last_event_vehicle": "",
          "last_event_licence_number": "",
          "last_event_location": "",
          "last_event_latitude": "",
          "last_event_longitude": "",
          "last_event_direction": "",
          "driver_main_vehicle_id": "",
          "driver_main_vehicle_license_number": "",
          "driving_hours": "12.50",
          "safety_events": "3",
          "mechanical_events": "1",
          "normalized_to_100": "94.20"
        }
      ],
      "pagination": {
        "page": 1,
        "page_size": 100,
        "has_more": true
      }
    }
  }
}