Get Data
Action: "api_get_data"
Use this API to fetch specific vehicle / all fleet current data.
In order to get data for all allowed vehicles you need to leave the license_nmbr field empty or not send it at all.
In order to get incremental data on vehicles which were updated later than a point of time you need to provide this time in last_time parameter.
Request Parameters:
Parameter Name | Type | Mandatory/Optional/Conditional | Description |
---|---|---|---|
last_time | datetime | Optional | YYYY-MM-DDTHH:MM:SS , will be used to fetch incremental data |
license_nmbr | string | Optional | request data for specific vehicle, if no value is provided the response will include all allowed vehicles |
Request Example:
{
"action": {
"name": "api\_get\_data",
"parameters": \[{
"last\_time": "",
"license\_nmbr": ""
}\],
"session\_token": "13AAF-8EB8-48F2-B28E-1114D72C"
}
}
Response Parameters:
Parameter Name | Type | Occurrences | Description |
---|---|---|---|
vehicle_id | big integer | 1..1 | Traffilog unique id for the vehicle |
unit_id | big integer | 1..1 | Traffilog unit unique id for the vehicle |
unit_serial | string | 1..1 | Traffilog unique unit serial |
license_nmbr | string | 1..1 | Vehicle license number |
chassis_number | string | 0..1 | Vehicle chassis number |
last_communication_time | datetime | 1..1 | Unit communication time stamp. GMT (including DLS) without offset |
last_position_time | datetime | 1..1 | GPS time stamp. GMT (including DLS) without offset |
latitude | decimal (10,2) | 1..1 | |
longitude | decimal (10,2) | 1..1 | |
speed | decimal (10,2) | 1..1 | Vehicle last known speed |
direction | integer | 1..1 | GPS angle/bearing |
status | tiny integer | 1..1 | Vehicle status: “0”- ignition off” “1”-ignition on “2”-ignition on , engine in idle |
last_event_time | datetime | 0..1 | Vehicle last event time stamp |
last_event_type | string | 0..1 | Vehicle last event description |
current_driver | big integer | 0..1 | Current driver id. Will be provided only if there was driver authentication. |
current_driver_number | string | 0..1 | Current driver code. Will be provided only if there was driver authentication. |
driver_name | string | 0..1 | Current driver name. Will be provided only if there was driver authentication. |
current_drive | big integer | 0..1 | Current trip id. Will be provided if the vehicle has current drive. |
last_mileage | decimal (10,2) | 0..1 | Vehicle current mileage |
Response Example:
{
"response": {
"properties": {
"action\_name": "api\_get\_data",
"data": \[{
"vehicle\_id": "2632490",
"unit\_id": "273047",
"license\_nmbr": "663-RT-0053",
"chassis\_number": "6XDRF45F",
"last\_communication\_time": "2016-12-26T20:52:44.847",
"last\_position\_time": "2016-12-26T18:42:29",
"latitude": "32.0062360",
"longitude": "34.7878760",
"speed": "0.00",
"direction": "0",
"status": "0",
"last\_event\_time": "2016-12-26T18:42:29",
"last\_evet\_type": "Ignition Off",
"current\_driver": "",
"current\_driver\_number": "",
"driver\_name": "",
"current\_drive": "",
"last\_mileage": "15709.54"
}, {
"vehicle\_id": "345246",
"unit\_id": "2649807",
"license\_nmbr": "49-FD-72",
"chassis\_number": "",
"last\_communication\_time": "2016-12-26T21:18:05",
"last\_position\_time": "2016-12-26T21:18:05",
"latitude": "32.1864660",
"longitude": "34.9363380",
"speed": "91.00",
"direction": "67",
"status": "1",
"last\_event\_time": "2016-12-26T121:02:07",
"last\_evet\_type": "agresive turn",
"current\_driver": "121245",
"current\_driver\_number": "122345",
"driver\_name": "Driver Test",
"current\_drive": "1123456",
"last\_mileage": "179.54"
}\],
"action\_value": "0",
"description": "",
"session\_token": "8ba6e021fccc478ea55272843675"
}
}
}
Action Values:
action_value | description |
---|---|
0 | success |
2 | The User not allowed for the vehicle/driver or no such vehicle/driver. |
999 | general error |