List transition alert history
Service version: 1
Last edit: 2020.09.30
On this page
Purpose
This endpoint lists Transition Alerts that have been triggered in the given time range.
We highly recommend using the new, generic endpoint to handle all types of historical Alert entries: List Alert History.
Request data
HTTPS method: GET
URL format
For ease of viewing and identification:
- Required constants and parameters are shown in bold text.
- Optional parameters are shown in normal text.
https://baseURL/geofencing/versionNumber/alerts/transitions/history?key=Your_API_Key&from=timestamp[&to=timestamp][&maxResults=integer][&pageNumber=integer]
curl command
curl 'https://baseURL/geofencing/versionNumber/alerts/transitions/history?key=Your_API_Key&from=timestamp[&to=timestamp][&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.
- If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table.
- The order of Request parameters is not important.
Required parameters | |
---|---|
Parameter | Description |
baseURL string |
The base URL for calling the API. Value: api.tomtom.com |
versionNumber string |
Service version. Value: 1 |
key string |
An API Key valid for the requested service. Value: Your valid API Key . |
from timestamp |
The beginning date for a listing. Value: ISO 8601 format timestamp with the accuracy of seconds (YYYY-MM-DDThh:mm:ss). |
Optional parameters | |
[to] timestamp |
End date for the listing. Value: ISO 8601 format timestamp with the accuracy of seconds (YYYY-MM-DDThh:mm:ss). |
[maxResults] integer |
Maximum number of items returned in the Response. Value: Greater than zero, less than or equal to 100. Default value: 100 |
[pageNumber] integer |
The number of the items page to be returned in the Response. The maximum number of elements on the page is equal to the maxResults value. Value: Greater than zero. Default value: 1 |
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",
"transitionType": "type_of_the_alert"
}
],
"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 |
summary object |
Contains information about the transitions alert history Request. |
alerts array(alert) |
Array of historical alerts. |
resultInfo object |
Contains information about Response paging. |
summary{} object |
|
Field | Description |
from string |
Timestamp (ISO 8601 format) marking the start of a period the report is generated for. |
to string |
Timestamp (ISO 8601 format) marking the end of a period the report is generated for. |
alerts[] array |
|
Field | Description |
id string |
The UUID of the historical alert. |
name string |
The name of the alert. |
object string |
UUID of an object that triggered an alert. |
fence string |
UUID of a fence that triggered an alert. |
project string |
UUID of an project for which the alert was triggered. |
transitionType string |
Type of the transition that triggered an alert. |
resultInfo{} object |
|
Field | Description |
maxResults integer |
Maximum number of items returned in the Response. |
pageNumber integer |
Number of the items page to be returned in the Response. Maximum number of elements on the page is equal to the maxResults value. |
itemsCount integer |
Number of returned items on the page. |
HTTP Response codes
Code | Meaning and possible causes |
---|---|
200 |
OK |
400 |
Bad Request: The value of the parameter is not a positive decimal number. |
Examples
Example: List all of the alerts triggered between 2019-08-29T01:00:00 and 2019-08-29T23:00:00.
Request format
https://api.tomtom.com/geofencing/1/alerts/transitions/history?key=PJD7y0G5AFj9Jiok6F0tIK16NiWYotb3&from=2019-08-29T01:00:00&to=2019-08-29T23:00:00&maxResults=3&pageNumber=1
Response body
{
"summary": {
"from": "2019-08-29T01:00:00",
"to": "2019-08-29T23: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",
"transitionType": "EXIT"
}
],
"resultInfo": {
"maxResults": 100,
"pageNumber": 1,
"itemsCount": 1
}
}