API V2
-
Get Token
-
Get List of Active Vehicles with MVA numbers
-
Get Vehicle statistic by MVA number
To use API first you have to get authorization token.
Get Token
URL: https://<address>/api/v2/login
Method: POST
Headers: Content-Type: application/json
Body : {"UserName":"YOUR_LOGIN","Password":"YOUR_PASSWORD"}
Example:
POST /api/v2/login HTTP/1.1
Host: pilot-gps.com
Content-Type: application/json
Content-Length: 72
{"UserName":"xxxxxxx","Password":"xxxxxxx"}
Response:
4d9c85fbee217c26664f5a6ea212d852bc993fa51d54f5c67bb04f77ba3b0a3b
You can use token in ag-token http header to authorize your requests to API
Get List of Active Vehicles with MVA numbers
URL: https://<address>/api/v2/mvalist
Method: GET
Example:
GET /api/v2/mvalist HTTP/1.1
Host: pilot-gps.com
ag-token: 4d9c85fbee217c26664f5a6ea212d852bc993fa51d54f5c67bb04f77ba3b0a3b
Content-Length: 40
Answer:
{
"code": 0,
"data": [
{
"platenumber": "JDT696EC",
"agentid": 25687,
"imei": "869606020274365",
"mvanumber": "2237798"
},
{
"platenumber": "JDT713EC",
"agentid": 25689,
"imei": "869606020275990",
"mvanumber": "2237795"
},
{
"platenumber": "FY38HPGP",
"agentid": 27053,
"imei": "869606020172106",
"mvanumber": "2143634"
},
{
"platenumber": "JT62XXGP",
"agentid": 26545,
"imei": "869606020345173",
"mvanumber": "2449220"
}
]
}
Get Vehicle statistic by MVA number
URL: https://<address>/api/v2/mvastat
Method: POST
Headers: Content-Type: application/json
Body : {"mva":[mva_1,mva_2,mva_3], "month":202204}
Example:
POST /api/v2/mvastat HTTP/1.1
Host: pilot-gps.com
ag-token: 4d9c85fbee217c26664f5a6ea212d852bc993fa51d54f5c67bb04f77ba3b0a3b
Content-Type: application/json
Content-Length: 40
{"mva":[2291776,2132288],"month":202204}
Answer:
{
"code": 0,
"data": [{
"platenumber": "HZ65FFGP",
"agentid": 19405,
"mvanumber": "2336715",
"time_zone": "Africa/Johannesburg",
"period": 202210,
"ts": 1664575200,
"te": 1667253600,
"max_speed": 164,
"avg_speed": 49,
"km_driven": 1661.25,
"driving_time_sec": 121150,
"trips_cnt": 90,
"road_speeding": {
"duration": 6818,
"count": 105
},
"harsh_acceleration": 120,
"harsh_breaking": 29,
"harsh_turn": 0,
"excess_idling": 0,
"harsh_acceleration_fee": 32.4,
"harsh_breaking_fee": 5.2,
"harsh_turn_fee": 0,
"excess_idling_fee": 0,
"speeding": 36,
"speeding_fee": 9.7,
"eco_driving_score": 52.7,
"total": 447
},
{
"platenumber": "HZ65FFGP_123",
"agentid": 19406,
"mvanumber": "2336716",
"time_zone": "Africa/Johannesburg",
"period": 202210,
"ts": 1664575200,
"te": 1667253600,
"max_speed": 164,
"avg_speed": 49,
"km_driven": 1661.25,
"driving_time_sec": 121150,
"trips_cnt": 90,
"road_speeding": {
"duration": 6818,
"count": 105
},
"harsh_acceleration": 120,
"harsh_breaking": 29,
"harsh_turn": 0,
"excess_idling": 0,
"harsh_acceleration_fee": 32.4,
"harsh_breaking_fee": 5.2,
"harsh_turn_fee": 0,
"excess_idling_fee": 0,
"speeding": 36,
"speeding_fee": 9.7,
"eco_driving_score": 52.7,
"total": 447
}]
}