Vehicle statuses
This API retrieves a list of vehicle statuses (if there is a driver–vehicle link and the mobile app is used).
How to get data
Request address
To get the data, use the address: http://tasks.<server_address>/backend/public/dictionary/devices/statuses
Request method
GET
Request parameters
-
page — page number for selection (used for table visualization). Default: 1
-
start — offset for selection (used in SQL queries). Default: 0
-
limit — number of records to fetch. Default: 25
-
usr_id — user ID (from the authorization object)
-
acc_id — account ID (from the authorization object)
Example request
fetch("http://tasks.<server_address>/backend/public/dictionary/devices/statuses?_dc=1597911482354&page=1&start=0&limit=100", {
method: "GET",
headers: {
"accept": "*/*",
"accept-language": "uk-UA,uk;q=0.9,ru;q=0.8,en-US;q=0.7,en;q=0.6",
"x-csrf-token": "CtrsOKz3NykfxWlyboPlq3LGNpPrWsCtIymrKq0G"
},
credentials: "include"
})
|
Response
{
"page": 1,
"items": [
{
"Id": 1,
"c_name": "In Service",
"c_information": {"description":"Vehicle is currently in service"},
"c_status_type_id": 2,
"c_function_name": "setServiceStatus",
"c_function_arg": "active",
"c_status_type_name": "Operational",
"c_trigger": "automatic",
"c_account_id": 1107,
"c_status_task_id": 154955
},
{
"Id": 2,
"c_name": "Idle",
"c_information": {"description":"Vehicle is not currently assigned to any task"},
"c_status_type_id": 1,
"c_function_name": "setIdleStatus",
"c_function_arg": "",
"c_status_type_name": "Availability",
"c_trigger": "manual",
"c_account_id": 1107,
"c_status_task_id": null
}
],
"total": 2
}
|
In response to the API request, the following is returned:
-
Id — record ID
-
c_name — status name
-
c_information — additional information (JSON)
-
c_status_type_id — status type ID
-
c_function_name — function name
-
c_function_arg — function argument
-
c_status_type_name — status type name
-
c_trigger — status change trigger
-
c_account_id — account ID
-
c_status_task_id — task status ID