Trips API

Trips API is dedicated to output object’s trips history for the requested period.

Request structure:

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

Request parameters:

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

Response example:

{
	"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"
            },
          },
	...
	]
}

If a parameter was entered incorrectly, the system will respond with an error code. All error codes are described in the APIs section. Parameters for which no data is provided are not included in the response. A full list of response parameters is available at the end of this section.

Response parameters:

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