User Manual
Version 7.6
×

Equipment operation

 
Example:
http://<url>/api/api.php?cmd=sensors&imei
 
Options:
cmd : sensors
imei : list of IMEI separated by commas
agents : list of AgentID separated by commas
veh_numbers : state. car numbers separated by commas
start : sampling start time
stop : sampling ending time
 
Data format:
Array of sensors over time
Request for one car:
"sensors": {
 "9175": { key - object id in PILOT system
 "fieldname": "DIS1", - field where sesnors value come in
 "info": "Ignition", - sensor name in PILOT system
 "id": 9175, - sensor id in PILOT system
 "work": {
 "1404637430": { key - time when sensor turns on
 "ts": 1404637430,
 "te": 1404637834, - time when sensor turns off
 "lat": "46.3825", - lat at the turns on moment
 "lon": "48.0031", - lon at the turns on moment
 }
 }
}
 
Request for several cars:
{
 "A098F":{ // key depending on what whas used in request (imei, vehnumber or agent_id)
 "sensors":{
 "9175":{
 "fieldname":"DIS1",
 "info":"Ignition",
 "id":9175,
 "work":{
 "1404637430":{
 "ts":1404637430,
 "te":1404637834,
 "lat":"46.3825",
 "lon":"48.0031"
 }
 }
 }
 }
 },
 "D66gD":{
 "sensors":{
 "9178":{
 "fieldname":"DIS1",
 "info":"Ignition",
 "id":9175,
 "work":{
 "1404637430":{
"ts":1404637430,
"te":1404637834,
"lat":"46.3825",
"lon":"48.0031"
}
}
}
}
}
}
 
Example :
http://<url>/api/api.php?cmd=sensors&imei=356307046690011&start=1404637430&stop=1404645198
{
 "code": 0,
 "msg": "OK",
 "sensors": {
 "9175": {
 "fieldname": "DIS1", // sensor field name
 "info": "Ignition Sensor", // sensor name
 "id": 9175, // sensor id
 "work": { // work section
 "1404637430": {
 "ts": 1404637430, //start time unixtimestamp
 "te": 1404637834, //stop time unixtimestamp
 "lat": "46.3825", // position latitude
 "lon": "48.0031" // position longitude
 
 },
 "1404638577": {
 "ts": 1404638577,
 "te": 1404639841,
 "lat": "46.3625",
"lon": "48.0478"
},
"1404640381": {
"ts": 1404640381,
"te": 1404640534,
"lat": "46.3661",
"lon": "48.0557"
},
"1404640748" : {
"ts": 1404640748,
"te": 1404641043,
"lat": "46.3661",
"lon": "48.0557"
},
"1404644617": {
"ts": 1404644617,
"te": 1404645145,
"lat ": "46.3762",
"lon": "48.0528"
},
"1404645195": {
"ts": 1404645195,
"te": 1404645198,
"lat": "46.3667",
"lon": "48.029"
}
}
}
}
}
}