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:
Parameter | Type | Description | Required |
---|---|---|---|
objectId | String | External object ID | Yes |
from_datetime | Date time | Finds records starting from the specified date and time. Date and time format example: “2017-04-13T06:58:48.090Z” | Yes |
to_datetime | Date time | Finds records ending at the specified date and time. Date and time format example: “2017-04-13T06:58:48.090Z” | No |
continuation_token | Date time | Displays from what date and time the data is shown if the record limit was reached. | No |
limit | Integer | How many records will be included in the response (default value - 100 records, maximum value - 1000 records). | No |
version | String | API version | Yes |
api_key | String | User identification key | Yes |
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:
Parameter | Type | Description | Units |
---|---|---|---|
continuation_token | String | Displays from what date and time the data is shown if the record limit was reached. | |
trips | Array | Contains all parameters in accordance to the request | |
object_id | String | Object identifier | |
trip_type | Enum | Trip type Possible values: UNKNOWN NONE PRIVATE BUSINESS WORK | |
trip_duration | Datetime | Trip duration | s |
mileage | Number | Mileage pass during the trip | m |
driver_ids | Array | Container for all driver IDs assigned to the vehicle during the trip. | |
trip_start | Array | Container for trip start parameters | |
datetime | Datetime | Date and time point of coordinate generated in hardware Format: "yyyy-mm-ddThh:mm:ss.sssZ" | Datetime |
longitude | Number | Longitude | Degrees |
latitude | Number | Latitude | Degrees |
address | Array | Container for address parameters | |
country | String | Country name | |
country_code | String | Country code | |
county | String | County name | |
region | String | Region name | |
locality | String | Locality name | |
street | String | Street name | |
house_number | String | House number | |
zip | String | ZIP code | |
trip_end | Array | Container for trip end parameters |