Vehicles/get_module_state_api
get_module_state_apitoken required
Returns per-module health/state for a single vehicle (capability, active, ok flags, last update, error info) with SP-compatible colour hints.
POST
/api— body field action.name = "get_module_state_api"Parameters
| Name | Type | Required | Description |
|---|---|---|---|
vehicle_id | number | required | Positive vehicle id to query. Missing or non-positive values return errorcode '1'.e.g. 591723 |
application_token | string | optional | Accepted on the wire for legacy SP shape compatibility. Value is ignored — session auth is the real surface.e.g. |
with_debug | string | optional | Legacy debug flag accepted on the wire and ignored. A non-empty / non-'0' value is logged as a warning.e.g. 0 |
Notes
errorcode '2' = vehicle not found; vehicles without a resolvable unit return `data: []` with action_value '0'. When the vehicle has no active module-state rows, a single placeholder row (module_id='-1', module_descr='other') is emitted to keep the response shape stable for mobile clients — that row means “no module state for this vehicle”, not “unknown module”. Module, sub-module and error names are resolved from reference data; a small number of sub-module codes are not in that reference data yet and render as `other` while the module, its status and its timestamp remain correct.
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_module_state_api","parameters":[{"vehicle_id":591723,"with_debug":"0"}]}}'Body
{
"action": {
"name": "get_module_state_api",
"parameters": [
{
"vehicle_id": 591723,
"with_debug": "0"
}
]
}
}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_module_state_api",
"action_value": "0",
"description": "success",
"data": [
{
"template_name": "module_state",
"module_id": "1",
"module_descr": "Engine",
"sub_module_id": "2",
"sub_module_descr": "Coolant",
"color": "#008000",
"last_update_date": "2025-09-10T12:00:00",
"can_be_active": "1",
"can_be_active_color": "#008000",
"active": "1",
"active_color": "#008000",
"was_ok": "1",
"was_ok_color": "#008000",
"ok": "1",
"ok_color": "#008000",
"error": "0",
"error_descr": ""
}
]
}
}
}