ecotruck_api-instrukcja
ecotruck_api-instrukcja
Tracking Service
REST API is a web interface that you can use to access location data of customers’ vehicles
without using the ecoTRUCK user interface. With API access, you can integrate location data
into external applications. REST API uses RESTful architecture to provide a straightforward
and consistent interface. A primary benefit of REST API is that it doesn’t require much
tooling to access necessary data.
Authentication
To access location data you need to provide a valid API key, which is issued at the vehicle
owner’s request. A single API key is only valid for one integration. Limitations of data access
are configured by the vehicle owners (on a vehicle by vehicle basis). API Keys are invalidated
after 6 months and should be renewed in advance. To obtain an API key vehicle owners
should contact us at [email protected] with an API key generation request.
You as a data integrator are responsible for your API key instance and its usage. Once the
key is sent to you, ecoTRUCK can no longer recover it. ecoTRUCK is not responsible for
confidential data disclosure due to unauthorized key usage by third parties. If you suspect
that your key was leaked, please contact us at [email protected] immediately.
To authenticate a request one must provide a valid API key in the “Authorization”
header, formatted as follows: “Api-Key <key-string>”
Example request:
(GET) https://api.eco-truck.eu/vehicle/gps?plate=DW%201111
Example response:
{
"plate" : "DW 1111",
"timestamp" : "2021-07-21T11:34:12Z",
"latitude" : 51.10401,
"longitude" : 16.93532,
"speed" : 79, in km/h*
"heading" : 180 in deg*
}
plate is a valid registration plate saved in the ecoTRUCK system. Only letters, numbers and
spaces are allowed.
Limitations:
Only one vehicle can be accessed per request. Each vehicle’s position can be requested no
more than once per minute.
Example request:
(GET) https://api.eco-truck.eu/vehicle/gps/history?plate=DW+1111&
start_time=1626867247&end_time=1626870847
Example response:
{
"plate": "DW 1111",
"locations": [
{
"timestamp": "2021-07-21T11:34:12Z",
"latitude": 51.10401,
"longitude": 16.93532,
"speed": 79, in km/h*
"heading": 180 in deg*
},
{
"timestamp": "2021-07-21T11:35:06Z",
"latitude": 51.09999,
"longitude": 16.93544,
"speed": 71, in km/h*
"heading": 194 in deg*
},
...
]
}
plate is a valid registration plate saved in the ecoTRUCK system. Only letters, numbers and
spaces are allowed.
start_time and end_time determine the desired historical data time range. Both fields
should follow the Unix time format.
Limitations:
Only one vehicle per request. Each vehicle position can be requested once every 10 minutes.
start_time limitation is set by the vehicle owner and cannot be older than 7 days.
OK
200
request accepted; data sent
Bad request
400 e.g. unsupported request type, badly formatted request (more info can be
found in the request’s “error” field)
Forbidden
403 no permission for requested resource e.g. expired API key, incorrectly
formatted authentication header, vehicle(s) unavailability in accordance with
the owner’s configuration
Service unavailable
503
the service handling device data is not running at the queried address