List alert history
Decommission notice
Purpose
This endpoint lists Alerts that have been triggered in the given time range.
Request data
HTTPS method: GET
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
URL request format
https://{baseURL}/geofencing/{versionNumber}/alerts/history?key={Your_API_Key}&from={timestamp}&to={timestamp}&alertType={string}&maxResults={integer}&pageNumber={integer}curl command request format
curl 'https://{baseURL}/geofencing/{versionNumber}/alerts/history?key={Your_API_Key}&from={timestamp}&to={timestamp}&alertType={string}&maxResults={integer}&pageNumber={integer}'Request parameters
The following table describes the parameters that can be used in a request.
- Required parameters must be used or the call will fail.
- Optional parameters may be used.
- The order of request parameters is not important.
Required parameters | Description |
|---|---|
| The base URL for calling the API. |
| Service version. |
| An API Key valid for the requested service. |
| The beginning date for a listing. |
Optional parameters | Description |
|---|---|
| End date for the listing. |
| Type of the Alert to filter by. |
| Maximum number of items returned in the response. |
| The number of items page to be returned in the response. The maximum
number of elements on the page is equal to the maxResults value. |
Response data
Response body
{ "summary": { "from": "ISO8601_timestamp", "to": "ISO8601_timestamp" }, "alerts": [ { "id": "uuid_string", "name": "name_of_the_alert", "object": "uuid_string", "fence": "uuid_string", "project": "uuid_string", "alertType": "type_of_the_alert", "details": { "key": "value" } } ], "resultInfo": { "maxResults": number, "pageNumber": number, "itemsCount": number }}Response fields
The following table describes all of the fields that can appear in a response.
Primary fields | |
|---|---|
Field | Description |
| Contains information about the Alert History request. |
| Array of historical Alerts. |
| Contains information about response paging. |
summary object | |
Field | Description |
| Timestamp (ISO 8601 format) marking the start of a period the report is generated for. |
| Timestamp (ISO 8601 format) marking the end of a period the report is generated for. |
alerts array | |
Field | Description |
| The UUID of the historical Alert. |
| The name of the Alert. |
| UUID of an Object that triggered an Alert. |
| UUID of a Fence that triggered an Alert. |
| UUID of an Project for which the Alert was triggered. |
| Type of the Alert that was triggered. |
| Contains information about a specific Alert. |
details object | |
Field | Description |
| Type of the Transition that triggered an Alert. |
| Time limit that triggered an Alert. |
| Estimated dwell time of an Object in a Fence. |
| Object count limit that triggered an Alert. |
| Current number of Objects in a Fence. |
| Proximity distance limit that triggered an Alert. The value is expressed
in meters. |
| Current distance of the Object to the Fence. The value is expressed in
meters. |
| Side of the fence in which the proximity was measured. |
resultInfo object | |
Field | Description |
| Maximum number of items returned in the response. |
| Number of the items page to be returned in the response. The maximum
number of elements on the page is equal to the |
| Number of returned items on the page. |
HTTP response codes
Code | Meaning & possible causes |
|---|---|
| OK |
| Bad Request: The value of the parameter is not a positive decimal number. |
Example
List all of the Transition Alerts triggered between 2019-08-29 10:00:00 and 2019-08-29 16:00:00.
URL request example
https://api.tomtom.com/geofencing/1/alerts/history?key=PJD7y0G5AFj9Jiok6F0tIK16NiWYotb3&from=2019-08-29T10:00:00&to=2019-08-29T16:00:00&alertType=TRANSITION&maxResults=3&pageNumber=1Response body example
{ "summary": { "from": "2019-08-29T10:00:00", "to": "2019-08-29T16:00:00" }, "alerts": [ { "id": "6141c4be-0877-4fa6-bc25-37618a80f6d3", "name": "Drone flew out of safe zone", "object": "b95ca74e-5f67-4c2d-9c80-b589fee3227a", "fence": "e487153c-a08f-480f-8037-a9770a9a2ab9", "project": "51192c51-9255-41c6-9d36-93efde94a180", "alertType": "TRANSITION", "alertRuleConstraints": { "transitionType": "EXIT" } } ], "resultInfo": { "maxResults": 100, "pageNumber": 1, "itemsCount": 1 }}