Events/get_dtc_events

get_dtc_eventstoken required

Returns Diagnostic Trouble Code (DTC) events for a list of vehicles, groups or licenses over a window of up to 72 hours.

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

Parameters

NameTypeRequiredDescription
license_liststringoptionalComma-separated list of license plates. At least one of license_list/group_list/vehicle_id_list is required.e.g. AB-123-CD,EF-456-GH
group_liststringoptionalComma-separated list of group ids.e.g. 10,11
vehicle_id_liststringoptionalComma-separated list of vehicle ids.e.g. 555,556,557
from_datedateoptionalStart of date range. Defaults to `to_date - 3 days` when omitted.e.g. 2026-04-26T00:00:00Z
to_datedateoptionalEnd of date range. Defaults to now when omitted.e.g. 2026-04-27T00:00:00Z

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_dtc_events","parameters":[{"license_list":"AB-123-CD,EF-456-GH","group_list":"10,11","vehicle_id_list":"555,556,557","from_date":"2026-04-26T00:00:00Z","to_date":"2026-04-27T00:00:00Z","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. At least one of `license_list`, `group_list`, or `vehicle_id_list` is required. Date defaults: `to_date` defaults to now and `from_date` defaults to `to_date - 3 days`. Window > 72 hours returns action_value '1'. `recommendation`, `duration`, `first_occured`, `last_occured` are returned as empty strings (no PG analog).

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_dtc_events","parameters":[{"license_list":"AB-123-CD,EF-456-GH","group_list":"10,11","vehicle_id_list":"555,556,557","from_date":"2026-04-26T00:00:00Z","to_date":"2026-04-27T00:00:00Z"}]}}'
Body
{
  "action": {
    "name": "get_dtc_events",
    "parameters": [
      {
        "license_list": "AB-123-CD,EF-456-GH",
        "group_list": "10,11",
        "vehicle_id_list": "555,556,557",
        "from_date": "2026-04-26T00:00:00Z",
        "to_date": "2026-04-27T00:00:00Z"
      }
    ]
  }
}

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_dtc_events",
      "action_value": "0",
      "description": "success",
      "data": [
        {
          "oid": "11223344",
          "license_nmbr": "AB-123-CD",
          "timestamp": "2026-04-27T08:10:00Z",
          "spn": "100",
          "spn_description": "Engine Oil Pressure",
          "fmi": "5",
          "fmi_description": "Current below normal",
          "source": "ECM",
          "fault_description": "Low oil pressure",
          "severity": "2",
          "sign": "1",
          "latitude": "32.0901000",
          "longitude": "34.8000000",
          "additional_fault_description": "",
          "recommendation": "",
          "duration": "",
          "first_occured": "",
          "last_occured": "",
          "vehicle_id": "555",
          "group_id": "10",
          "group_name": "Tel Aviv Fleet"
        }
      ],
      "pagination": {
        "page": 1,
        "page_size": 100,
        "has_more": true
      }
    }
  }
}