API za povijest događaja namijenjen je ispisu povijesti događaja objekta za traženo razdoblje.
Struktura zahtjeva:
GET /otkriveni-događaji?id_objekta=<...>&from_datetime= <...>&to_datetime= <...>&continuation_token= <..>&limit= <..>&version=1&api_key= <..>HTTP/1.1
Domaćin: api.fm-track.com
Vrsta sadržaja: application/json; charset=UTF-8
Parametri zahtjeva:
| Parameter | Type | Description | Required |
|---|---|---|---|
| object_id | String | External object ID | Yes |
| from_datetime | Date time | Find events starting from specified date | Yes |
| to_datetime | Date time | Find events ending to specified date | Yes |
| continuation_token | Integer | Displays from what date and time the data is shown if the record limit was reached | No |
| limit | Integer | Limits events count in response | No |
| version | String | API version | Yes |
| api_key | String | User identification key | Yes |
Primjer odgovora:
{
"continuation_token": 1,
"events": [
{
"name": "ToyotaIgnition",
"description": "TestIgnition",
"driver_id": null,
"trip_type": "NONE",
"duration": 31,
"start": {
"datetime": "2020-02-10T09:13:23.000Z",
"location": {
"latitude": 54.924457,
"longitude": 23.872841
},
"mileage": 6000.0,
"speed": 40
},
"end": {
"datetime": "2020-02-10T09:13:54.000Z",
"location": {
"latitude": 54.924457,
"longitude": 23.872841
},
"mileage": 6000.0
}
},
...
]
}Ako je parametar netočno unesen, sustav će odgovoriti kodom pogreške. Svi kodovi pogrešaka opisani su u odjeljku API-ji . Parametri za koje nisu navedeni podaci nisu uključeni u odgovor. Potpuni popis parametara odgovora dostupan je na kraju ovog odjeljka.
Parametri odgovora:
| Parameter | Type | Description |
|---|---|---|
| continuation_token | Integer | Continuation token is sent when number of events in response exceed limit |
| events | Array | Container for all object events for selected period |
| name | String | Event name |
| description | String | Event description |
| driver_id | String | External driver ID |
| trip_type | Enum | Trip type |
| duration | Long | Event duration in seconds |
| start | Array | Container for event start information |
| end | Array | Container for event end information |
| datetime | Datetime | Date and time |
| location | Array | Container for coordinates |
| latitude | Double | Latitude |
| longitude | Double | Longitude |
| mileage | Double | Mileage in kilometres |
| speed | Integer | Speed in km/h |