Traffic report

 
Options:
cmd  : run
imei  : object identifier in the system
start  : sampling start time
stop  : sampling end time
zones  : include or not include information about the passage of geofences (0 or 1) If zones=1, each track (trip) within which there are entry points / exit to geofences will be divided into segments corresponding to the moments of entry and exit into geofences
eco : include eco driving data in tracks
 
zones =0 - the entire track is included.
zones =1 receive events on inputs/exits to/from geozones.
 
Requested data format:
array of zone entry/exit points
 
"zones": {
 "1406341994": { - key - time in unixtime
 "ts": 1406341994, -- time in unixtime
 "stopuid": "213854753412306", - zone identifier
 "stopname": "Garage", - zone name
 "lat": "53.3861", - latitude
 "lon": "83.7127", - longitude
 "msgtype": 2nd input or output (1-input 2-output)
 },
trips:
 
"tracks": {
 "1406341955": { - key - movement start time in unixtime
 "ts": 1406341955, - movement start time in unixtime
 "te": 1406341994, - movement end time in unixtime
 "length": 0.26, - mileage in kilometers
 "maxspeed": "17", - maximum speed
 "avgspeed": 17, - average speed
 "lats": "53.3861", - initial latitude
 "lons": "83.7127", - initial longitude
 "late": "53.3861 ", - final latitude
 "lone": "83.7127" - final longitude
 "eco": {
 "Acceleration": 100,
 "Braking": 300,
 "Speed": 200
 }
 },
 
Example request:
http://<url>/api/api.php?cmd=run&imei=359772039289781&start=1406318400&stop=1406404800&zones=1
http://pilot-gps.ru/api/api.php?cmd=run&imei=356307045913463&start =1455255940&stop=1455816857
 
Sample answer:
{
"code": 0,
"msg": "OK",
"zones": {
"1406341994": {
"ts": 1406341994,
"stopuid": "213854753412306",
"stopname": "Гараж",
"lat": "53.3861",
"lon": "83.7127",
"msgtype": 2
},
"1406353422": {
"ts": 1406353422,
"stopuid": "966971618589014",
"stopname": "Автовокзал Барнаула",
"lat": "53.3508",
"lon": "83.7593",
"msgtype": 1
},
"1406365244": {
"ts": 1406365244,
"stopuid": "966971618589014",
"stopname": "Автовокзал Барнаула",
"lat": "53.3494",
"lon": "83.7582",
"msgtype": 2
},
"1406386605": {
"ts": 1406386605,
"stopuid": "966971618589014",
"stopname": "Автовокзал Барнаула",
"lat": "53.3508",
"lon": "83.7591",
"msgtype": 1
},
"1406386882": {
"ts": 1406386882,
"stopuid": "966971618589014",
"stopname": "Автовокзал Барнаула",
"lat": "53.3536",
"lon": "83.7603",
"msgtype": 2
},
"1406388130": {
"ts": 1406388130,
"stopuid": "213854753412306",
"stopname": "Гараж",
"lat": "53.386",
"lon": "83.7081",
"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
},
"1406353422": {
"ts": 1406353422,
"te": 1406353469,
"length": 0.44,
"maxspeed": "19",
"avgspeed": 15
},
"1406365152": {
"ts": 1406365152,
"te": 1406365244,
"length": 0.45,
"maxspeed": "27",
"avgspeed": 21
},
"1406365244": {
"ts": 1406365244,
"te": 1406374145,
"length": 163.13,
"maxspeed": "101",
"avgspeed": 69
},
"1406378043": {
"ts": 1406378043,
"te": 1406386605,
"length": 162.01,
"maxspeed": "107",
"avgspeed": 73
},
"1406386605": {
"ts": 1406386605,
"te": 1406386871,
"length": 0.54,
"maxspeed": "22",
"avgspeed": 14
},
"1406386882": {
"ts": 1406386882,
"te": 1406388081,
"length": 6.16,
"maxspeed": "46",
"avgspeed": 29
},
"1406388130": {
"ts": 1406388130,
"te": 1406388323,
"length": 0.22,
"maxspeed": "11",
"avgspeed": 11
}
}
}