Cronologia eventi API

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:

ParameterTypeDescriptionRequired
object_idStringExternal object IDYes
from_datetimeDate timeFind events starting from specified dateYes
to_datetimeDate timeFind events ending to specified dateYes
continuation_tokenInteger Displays from what date and time the data is shown if the record limit was reachedNo
limitIntegerLimits events count in responseNo
versionStringAPI versionYes
api_keyStringUser identification keyYes

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:

ParameterTypeDescription
continuation_tokenIntegerContinuation token is sent when number of events in response exceed limit
eventsArrayContainer for all object events for selected period
nameStringEvent name
descriptionStringEvent description
driver_idStringExternal driver ID
trip_typeEnumTrip type
durationLongEvent duration in seconds
startArrayContainer for event start information
endArrayContainer for event end information
datetimeDatetimeDate and time
locationArrayContainer for coordinates
latitudeDoubleLatitude
longitudeDoubleLongitude
mileageDoubleMileage in kilometres
speedIntegerSpeed in km/h