L’API della cronologia degli eventi è dedicata all’output della cronologia degli eventi dell’oggetto per un periodo richiesto.
Struttura della richiesta:
GET /detected-events?object_id=<...>&from_datetime=<...>&to_datetime=<...>&continuation_token=<..>&limit=<..>&version=1&api_key=<..> HTTP/1.1
Host: api.fm-track.com
Content-Type: application/json;charset=UTF-8
Parametri della richiesta:
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 |
Esempio di risposta:
{ "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 } }, ... ] }
Se un parametro è stato inserito in modo errato, il sistema risponderà con un codice di errore. Tutti i codici di errore sono descritti nella sezione API. I parametri per i quali non vengono forniti dati non sono inclusi nella risposta. L’elenco completo dei parametri di risposta è disponibile alla fine di questa sezione.
Parametri di risposta:
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 |