Events history API is dedicated to output object’s events history for a requested period.
Request structure:
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
Request parameters:
Parameter | Type | Description | Required |
---|---|---|---|
object_id | String | External object ID | Yes |
from_datetime | Date time | Find events starting from specified date | Yes |
to_datetime | Date time | Find events ending to specified date | Yes |
continuation_token | Integer | Displays from what date and time the data is shown if the record limit was reached | No |
limit | Integer | Limits events count in response | No |
version | String | API version | Yes |
api_key | String | User identification key | Yes |
Response example:
{ "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 } }, ... ] }
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 |
---|---|---|
continuation_token | Integer | Continuation token is sent when number of events in response exceed limit |
events | Array | Container for all object events for selected period |
name | String | Event name |
description | String | Event description |
driver_id | String | External driver ID |
trip_type | Enum | Trip type |
duration | Long | Event duration in seconds |
start | Array | Container for event start information |
end | Array | Container for event end information |
datetime | Datetime | Date and time |
location | Array | Container for coordinates |
latitude | Double | Latitude |
longitude | Double | Longitude |
mileage | Double | Mileage in kilometres |
speed | Integer | Speed in km/h |