API Viaggi

L’API Trips è dedicata all’output della cronologia dei viaggi dell’oggetto per il periodo richiesto.

Struttura della richiesta:

GET /objects/{objectId}/trips?version=1&from_datetime=<..>&to_datetime=<..>&continuation_token=<..>&limit=<..>&api_key=<..> HTTP/1.1
HOST:api.fm-track.com
Content-Type:application/json;charset=UTF-8

Parametri della richiesta:

ParameterTypeDescriptionRequired
objectIdStringExternal object IDYes
from_datetimeDate timeFinds records starting from the specified date and time. Date and time format example: “2017-04-13T06:58:48.090Z”Yes
to_datetimeDate timeFinds records ending at the specified date and time. Date and time format example: “2017-04-13T06:58:48.090Z”No
continuation_tokenDate timeDisplays from what date and time the data is shown if the record limit was reached.No
limitIntegerHow many records will be included in the response (default value - 100 records, maximum value - 1000 records).No
versionStringAPI versionYes
api_keyStringUser identification keyYes

Esempio di risposta:

{
	"continuation_token": "2019-05-24T06:58:48.121Z",
	"trips": [
      {
        "object_id": "ID0000",
        "trip_type":"BUSINESS",
        "trip_duration": 4781,
        "mileage": 10.56,
        "driver_ids": ["asdf321","123asdf","fdsa123"],
        "trip_start": {
          "datetime": "2019-05-24T06:58:48.121Z",
          "longitude": 11.2222,,
          "latitude": 33.444,
          "address": {
            "country": "Denmark",
            "country_code": "DK",
            "county": "",
            "region": "",
            "locality": "Herlev",
            "street": "Unnamed Road",
            "house_number": "",
            "zip": "2730"
          },
          "trip_end": {
            "datetime": "2019-05-24T06:58:48.121Z",
            "longitude": 0,
            "latitude": 0,
            "address": {
              "country": "Denmark",
              "country_code": "DK",
              "county": "",
              "region": "",
              "locality": "Herlev",
              "street": "Unnamed Road",
              "house_number": "",
              "zip": "2730"
            },
          },
	...
	]
}

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:

ParameterTypeDescriptionUnits
continuation_tokenStringDisplays from what date and time the data is shown if the record limit was reached.
tripsArrayContains all parameters in accordance to the request
object_idStringObject identifier
trip_typeEnumTrip type
Possible values:
UNKNOWN
NONE
PRIVATE
BUSINESS
WORK
trip_durationDatetimeTrip durations
mileageNumberMileage pass during the tripm
driver_idsArrayContainer for all driver IDs assigned to the vehicle during the trip.
trip_startArrayContainer for trip start parameters
datetimeDatetimeDate and time point of coordinate generated in hardware
Format: "yyyy-mm-ddThh:mm:ss.sssZ"
Datetime
longitudeNumberLongitudeDegrees
latitudeNumberLatitudeDegrees
addressArrayContainer for address parameters
countryStringCountry name
country_codeStringCountry code
countyStringCounty name
regionStringRegion name
localityStringLocality name
streetStringStreet name
house_numberStringHouse number
zipStringZIP code
trip_endArrayContainer for trip end parameters