Raw data by IMEI
This API allows you to get raw device data for a specified time period.
How to get data
Method
GET
Request address
To get the data, use the address: https://<server_address>/api/api.php?
Request parameters
-
cmd=ag_events — API command to get raw points
-
imei — unique device identifier
-
ts — start time of the data (Unix timestamp)
-
te — end time of the data (Unix timestamp)
-
node — node number where the command should be executed
Example request
https://<server_address>/api/api.php?cmd=ag_events&ts=1498201000&te=1498201200&imei=356307045913463&node=1
|
Response
{
"code": 0,
"data": {
"1498201016": {"alt": 33, "lat": "47.2124", "lon": "39.6922", "sat": 15, "speed": 0, "ts": 1498201016},
"1498201037": {"alt": 29, "lat": "47.2124", "lon": "39.6924", "sat": 15, "speed": 6, "ts": 1498201037},
"1498201097": {"alt": 31, "lat": "47.2128", "lon": "39.6933", "sat": 15, "speed": 0, "ts": 1498201097}
},
"msg": "OK",
"vehicle": {
"agentid": 2914,
"created_time": 1359797592,
"current_mileage": 90224,
"folder": "Sky Electronics",
"imei": "356307045913463",
"type": "Cow",
"typeid": 31,
"vehiclenumber": "IX35"
}
}
|
In response to the API request, the following is returned:
-
code — result code (0 = success, other values = error)
-
msg — server message
-
data — object containing raw points, where keys are timestamps and values:
-
lat — latitude
-
lon — longitude
-
alt — altitude
-
sat — number of satellites
-
speed — speed
-
ts — event timestamp (Unix)
-
vehicle — information about the object:
-
agentid — agent identifier
-
created_time — object creation time
-
current_mileage — current mileage
-
folder — folder/group name
-
imei — device identifier
-
type — object type
-
typeid — object type ID
-
vehiclenumber — vehicle number