Trip report
This API is used for getting information about a vehicle’s trips over a specified period. When the Geofences module is enabled, each trip can be split into segments based on entry and exit from geofences.
How to get data
Method
GET
Request address
To get the data, use the address: https://<server_address>/api/api.php?
Request parameters
-
cmd=run — command to get the trip report
-
imei — unique identifier of the object (vehicle)
-
start — start time of the period (Unix timestamp)
-
stop — end time of the period (Unix timestamp)
-
zones — include geozone information:— 0 — tracks are returned as whole trips, without splitting by zones— 1— trips are split into segments based on entry/exit from geozones
-
eco— include eco-driving data in tracks
-
node — node number on which to execute the command
Example requests
https://<server_address>/api/api.php?cmd=run&imei=359772039289781&start=1406318400&stop=1406404800&zones=1&node=1
|
Response
{
"code": 0,
"msg": "OK",
"zones": {
"1406341994": {
"ts": 1406341994,
"stopuid": "213854753412306",
"stopname": "Garage",
"lat": "53.3861",
"lon": "83.7127",
"msgtype": 2
},
"1406353422": {
"ts": 1406353422,
"stopuid": "966971618589014",
"stopname": "Barnaul Bus Station",
"lat": "53.3508",
"lon": "83.7593",
"msgtype": 1
}
},
"tracks": {
"1406341955": {
"ts": 1406341955,
"te": 1406341994,
"length": 0.26,
"maxspeed": "17",
"avgspeed": 17
},
"1406341994": {
"ts": 1406341994,
"te": 1406353389,
"length": 119.83,
"maxspeed": "96",
"avgspeed": 58
}
}
}
|
In response to the API request, the following is returned:
Zones array (zones) — geofence entry and exit points:
-
ts — event time (Unix timestamp)
-
stopuid — unique geofence identifier
-
stopname — geofence name
-
lat — latitude of the point
-
lon — longitude of the point
-
msgtype — event type (1 = entry, 2 = exit)
Tracks array (tracks) — trip information:
-
ts — trip start time (Unix timestamp)
-
te— trip end time (Unix timestamp)
-
length — trip distance in kilometers
-
maxspeed— maximum speed during the trip (km/h)
-
avgspeed — average speed during the trip (km/h)
-
lats — latitude of trip start
-
lons — longitude of trip start
-
late — latitude of trip end
-
lone — longitude of trip end
-
eco — eco-driving data (if eco parameter is enabled):
-
Acceleration, Braking, Speed — metrics for each parameter