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:
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 |
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:
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 |