Mileage and fuel level
This API gets information about a vehicle’s mileage and fuel level at a specific moment in time.
How to get data
Method
GET
Request address
To get the data, use the address: https://<server_address>/api/api.php?
Request parameters
-
cmd=istatus — API command to get the status
-
imei — unique vehicle identifier in PILOT
-
unixtimestamp — timestamp for the requested moment (Unix timestamp)
-
node — node number where the command should be executed
Example request
https://<server_address>/api/api.php?cmd=istatus&unixtimestamp=1408840780&imei=356495042533101&node=1
|
Response
{
"code": 0,
"msg": "OK",
"total_run": 0,
"total_run_by_can": 0,
"engine_hours": 0,
"fuel_sensors": [
{
"info": "Fuel Sensor 1",
"id": 150325,
"fieldname": "t_53lls1",
"fuel": 0
},
{
"info": "Fuel Sensor 2",
"id": 150326,
"fieldname": "lls2",
"fuel": 0
}
],
"fuel": 0,
"unixtimestamp": 1408840780
}
|
In response to the API request, the following is returned:
-
total_run — total mileage of the vehicle at the requested time (km)
-
total_run_by_can — mileage according to CAN bus data (km)
-
engine_hours — engine hours in seconds
-
fuel — fuel level in the tank at the requested time (liters)
-
fuel_sensors — array of fuel sensors (if multiple sensors exist), each containing:
-
info — sensor description
-
id — unique sensor ID
-
fieldname — system field name of the sensor
-
fuel — fuel level recorded by this sensor (liters)
-
unixtimestamp — timestamp for which the data is returned (Unix timestamp)