Opouštíte nás, aniž byste si přečetli 10 tipů, jak ušetřit na správě vozového parku?
Zanechte nám svůj e-mail a my vám zašleme e-book na pozdější čtení.
GPS Dozor JSON API is a way for our customers to query for their location data in a machine-processable format. You can access realtime data, historical positions of your vehicles or even data preprocessed as trips with corresponding metadata.
The API is accessible at https://a1.gpsguard.eu/api/v1/
The login credentials are the same as those for the platform. Basic authentication over HTTPS is used.
Demo account:
Login: api_gpsdozor
Password: yakmwlARdn
1) Get list of available groups
List of groups to which you have permissions.
[{"Code":"SAGU","Name":"GPS Dozor - DEMO"}]
2) Get list of all vehicles in specific group
https://a1.gpsguard.eu/api/v1/vehicles/group/<group code>
i.e.: https://a1.gpsguard.eu/api/v1/vehicles/group/SAGU
Returns a list of vehicles, their name, registration plate, battery status (0 if the battery is not in use), current speed, GPS position and last response time (UTC).
[{
"Code": "CELIRASUME",
"GroupCode": "SATD",
"BranchId": "51",
"BranchName": "Pobocka 1",
"Name": "Mercedes-Benz",
"SPZ": "4EG 34-55",
"BatteryPercentage": 0,
"Speed": 86,
"LastPosition": {
"Latitude": "49.768475",
"Longitude": "13.649925"
},
"LastPositionTimestamp": "2018-02-09T15:25:34Z",
"LastEngineRelayEvent": "2018-02-01T00:00:00Z",
"EngineRelayState": 0,
"Odometer": 332969827
},
{
"Code": "OBEHEHUGOV",
"GroupCode": "SATD",
"Name": "Package",
"SPZ": "",
"BatteryPercentage": 0,
"Speed": 106,
"LastPosition": {
"Latitude": "43.664915",
"Longitude": "-97.760474"
},
"LastPositionTimestamp": "2018-02-09T15:26:11Z",
"LastEngineRelayEvent": "2018-02-01T00:00:00Z",
"EngineRelayState": 0,
"Odometer": 332969827
},
...
]
3) Get realtime information of specific vehicle
https://a1.gpsguard.eu/api/v1/vehicle/<vehicle code>
i.e.: https://a1.gpsguard.eu/api/v1/vehicle/ZODIDOZEBU
Returns the realtime information about a vehicle.
{
"Code": "ZODIDOZEBU",
"GroupCode": "SATD",
"BranchId": "51",
"BranchName": "Pobocka 1",
"Name": "Mercedes-Benz",
"SPZ": "4EG 34-55",
"BatteryPercentage": 0,
"Speed": 4,
"LastPosition": {
"Latitude": "49.7581",
"Longitude": "13.617875"
},
"LastPositionTimestamp": "2018-02-09T15:27:51Z",
"Odometer": 332969827
}
4) Get history of positions of specific vehicle
https://a1.gpsguard.eu/api/v1/vehicles/history/<coma separated vehicle codes>?from=<date+time from>&to=<date+time to>
Returns list of historical positions in specified time interval for selected vehicles.
[{
"Name": "MAN",
"VehicleCode": "ZODIDOZEBU",
"From": "2017-07-19T22:00:00Z",
"To": "2017-07-20T22:00:00Z",
"Positions": [{
"Lat": "49.429325",
"Lng": "12.012025",
"Time": "2017-07-19T22:00:04Z",
"Speed": 84
},
{
"Lat": "49.425525",
"Lng": "12.0049",
"Time": "2017-07-19T22:00:31Z",
"Speed": 90
},
},
{
"Lat": "49.422525",
"Lng": "12.0003",
"Time": "2017-07-19T22:00:51Z",
"Speed": 83
},
...
{
"Lat": "49.3991",
"Lng": "11.936325",
"Time": "2017-07-19T22:05:11Z",
"Speed": 82
}]
}]
5) Get history of trips
https://a1.gpsguard.eu/api/v1/vehicle/<vehicle code>/trips?from=<date+time from>&to=<date+time to>
i.e.: https://a1.gpsguard.eu/api/v1/vehicle/ZODIDOZEBU/trips?from=2018-05-20T00:00&to=2018-05-21T00:00
Returns history of trips with metadata for selected vehicle with start time between from/to dates.
[{
"AverageSpeed": 74,
"MaxSpeed": 98,
"TripType": false,
"StartTime": "2017-07-20T01:19:19",
"FinishTime": "2017-07-20T03:46:53",
"StartPosition": {
"Latitude": "49.174525",
"Longitude": "9.9951"
},
"FinishPosition": {
"Latitude": "49.4903",
"Longitude": "7.954725"
},
"StartAddress": "",
"FinishAddress": "",
"TripLength":" 02:27",
"TripWaitingTime": "00:00",
"TotalDistance": 181.274
"Purpose": "Pick-up delivery"
},
{
"AverageSpeed": 81,
"MaxSpeed": 99,
"TripType": false,
"StartTime": "2017-07-20T03:51:17",
"FinishTime": "2017-07-20T05:18:25",
"StartPosition": {
"Latitude": "49.490175",
"Longitude": "7.954"
},
"FinishPosition": {
"Latitude": "49.13425",
"Longitude": "6.546075"
},
"StartAddress": "",
"FinishAddress": "",
"TripLength":" 01:27",
"TripWaitingTime": "00:00",
"TotalDistance": 118.021
"DriverName": "Doe, John",
"DriverChipCode": "",
"Driver2Name": "Jump, Bob",
"Driver2ChipCode": "6734567890123466",
"Odometer": 2000,
"FuelConsumed": {
"Value": 0.12141838466142181,
"VolumeUnit": 0
},
"TripCost": {
"Value":1.45702061593706400,
"Currency": 0
}
},
...
]
Enum values:
VolumeUnit
{
Litre = 0,
UsGallon = 1,
UkGallon = 2
}
Currency
{
CZK = 0,
EUR = 1,
USD = 2,
PLN = 3,
HUF = 4,
BGN = 5,
BRL = 6,
BYR = 7,
CAD = 8,
CHF = 9,
...
}
6) Get engine relay state
https://a1.gpsguard.eu/api/v1/vehicle//getEngineRelayState
i.e.: https://a1.gpsguard.eu/api/v1/vehicle/ZODIDOZEBU/getEngineRelayState
Returns current engine relay state.
{
"RelayState": 0,
"LastEventTimestamp": "2018-04-23T16:17:31.0621104+02:00"
}
RelayState values:
0 - initial state
1 - lock engine request sent to device, not confirmed
2 - lock engine request sent to device, confirmed by system
3 - unlock engine request sent to device, unconfirmed
4 - unlock engine request sent to device and confirmed by system
5 - unable to lock engine, request denied or delayed by the device
7) Set engine relay state
https://a1.gpsguard.eu/api/v1/vehicle//setEngineRelayState/<on or off>
i.e.: https://a1.gpsguard.eu/api/v1/vehicle/ZODIDOZEBU/setEngineRelayState/off sends lock engine message to the device
or
https://a1.gpsguard.eu/api/v1/vehicle/ZODIDOZEBU/setEngineRelayState/on sends unlock engine message to the device
Returns current engine relay state.
{
"RelayState": 1,
"LastEventTimestamp": "2018-04-23T16:17:31.0621104+02:00"
}
Note: use getEnginerRelayState to check if lock or unlock message was received by the device
8) Reset engine relay state
https://a1.gpsguard.eu/api/v1/vehicle//resetEngineRelayState
i.e.: https://a1.gpsguard.eu/api/v1/vehicle/ZODIDOZEBU/resetEngineRelayState - resets vehicle state on the platform to initial state, no command is sent to the device
Caution: May cause discrepancy between the state shown on platform and the actual state of the vehicle! Use only if you are sure that engine is unlocked but engine relay state is incorrect.
Returns current engine relay state.
{
"RelayState": 0,
"LastEventTimestamp": "2018-04-23T16:17:31.0621104+02:00"
}
9) Get sensors data
https://a1.gpsguard.eu/api/v1/vehicle/<vehicle code>/sensors/Rpm?from=<date+time from>&to=<date+time to>
i.e.: https://a1.gpsguard.eu/api/v1/vehicle/AFOSINARAS/sensors/Rpm,Speed?from=2021-01-25T07:25&to=2021-01-25T07:30 - returns sensors data for Rpm and Speed sensors for selected interval for specified vehicle.
Available sensor types (depending on vehicle and device configuration):
{
"items": [
{
"name": "Rpm",
"units": "int",
"data": [
{
"t": "2020-05-26T15:02:49Z",
"v": 827
},
{
"t": "2020-05-26T15:04:47Z",
"v": 0
}
]
},
{
"name": "Speed",
"units": "KilometersPerHour",
"data": [
{
"t": "2020-05-26T15:02:49Z",
"v": 10.0
},
{
"t":" 2020-05-26T15:04:47Z",
"v": 13.0
}
]
}
]
}
10) Get data for Eco driving
https://a1.gpsguard.eu/api/v1/vehicle/<vehicle code>/eco-driving-events?from=<date+time from>&to=<date+time to>
i.e.: https://a1.gpsguard.eu/api/v1/vehicle/AFOSINARAS/eco-driving-events?from=2021-03-01T00:00&to=2021-03-02T00:00 - returns Eco-driving events for selected vehicle cellected between from/to dates
{
"EventType": 4,
"EventValue": 100,
"Timestamp": "2017-07-20T08:59:33",
"Position": {
"Latitude": 50.153774,
"Longitude": 14.51775
},
"EventSeverity": 0,
"Speed": 20
}
Enum values:
EventType
{
Unknown = 0,
CorneringLeft = 1,
CorneringRight = 2,
Cornering = 3,
Acceleration = 4,
Braking = 5,
Bump = 6,
LongClutch = 7,
DriveOnNeutral = 8,
LongFreeWheel = 9
}
EventSeverity
{
None = 0,
Low = 1,
Medium = 2,
High = 3,
}
11) Change the branch for a vehicle
PUT https://a1.gpsguard.eu/api/v1/vehicle/change-branch
Change the branch for the vehicle. The parameters for the change are sent in the request body.
Request body:
{
"VehicleCode": "CELIRASUME",
"BranchId": 1
}
12) Change the branch for a vehicle by branch name
PUT https://a1.gpsguard.eu/api/v1/vehicle/change-branch-by-name
Change the branch for the vehicle. The parameters for the change are sent in the request body. The branches in a given group must have a unique name.
Request body:
{
"VehicleCode": "CELIRASUME",
"BranchName": "Pobocka 1"
}
13) Get branches in the group
GET https://a1.gpsguard.eu/api/v1/groups/{groupCode}/branches
i.e.: https://a1.gpsguard.eu/api/v1/groups/sagu/branches - Returns branches for a specific group.
14) Change the purpose of the journey
POST https://a1.gpsguard.eu/api/v1/trip-purposes
Sets the driving purpose for the vehicle. The purpose of the journey is then displayed for all journeys for this vehicle. The driving purpose is valid from the moment it is created until it is replaced by a new one. The parameters for setting it are sent in the body of the request.
Request body:
{
"VehicleCode": "EVICIKEJIT",
"Purpose": "hezka jizda"
}