List alert rules

Service version: 1
Last edit: 2022.09.01

Purpose

This endpoint lists Alert Rules.

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

get
URL request format
https://{baseURL}/geofencing/{versionNumber}/alerts/rules?key={Your_API_Key}&project={uuid}&fence={uuid}&object={uuid}&alertType={string}&enabled={boolean}&notificationGroup={uuid}&maxResults={integer}&pageNumber={integer}

curl command request format

get
curl command request format
curl 'https://{baseURL}/geofencing/{versionNumber}/alerts/rules?key={Your_API_Key}&project={uuid}&fence={uuid}&object={uuid}&alertType={string}&enabled={boolean}&notificationGroup={uuid}&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

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.

Optional parameters

Description

project
string

UUID of a Project to filter by the specified UUID.
Default value: No value.

fence
string

UUID of a Fence to filter by the specified UUID.
Default value: No value.

object
string

UUID of a Object to filter by the specified UUID.
Default value: No value.

alertType
string

Type of the Alert to filter by.
Value: TRANSITION, DWELL, OBJECT_COUNT, PROXIMITY, or ALL
Default value: ALL.

enabled
string

Select Rules by enabled or disabled.
Value: true or false
Default value: No value.

notificationGroup
string

UUID of a Notification Group to filter by the specified UUID.
Default value: No value.

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

Response body format - JSON
1{
2 "alertsRules": [
3 {
4 "id": "The id of the alert rule",
5 "name": "The name of the alert rule"
6 }
7 ],
8 "resultInfo": {
9 "maxResults": max_number_of_results,
10 "pageNumber": page_number,
11 "itemsCount": number_of_results
12 }
13}

Response fields

The following table describes all of the fields that can appear in a response.

Primary fields

Field

Description

alertsRules
array (alert)

Array of configured Alerts for Fences with Objects.

resultInfo
object

Contains information about response paging.

alertsRules array

Field

Description

id
string

The UUID of the Alert Rule.

name
string

The name of the Alert Rule.

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.

Response codes

Code

Meaning & possible causes

200

OK

400

Bad Request: The value of the parameter is not a positive decimal number.

Example

List all enabled Alert Rules for the specific Project and Alert type.

URL request example

get
URL request example
https://api.tomtom.com/geofencing/1/alerts/rules?key=PJD7y0G5AFj9Jiok6F0tIK16NiWYotb3&project=ea06d8ab-762c-4f54-bb92-bde5cf35b9ff&alertType=TRANSITION&enabled=true&maxResults=3&pageNumber=1

Response body example

Response body example - JSON
1{
2 "alertsRules": [
3 {
4 "id": "2ce7d968-ddc5-4d16-97bd-ab0a72491c38",
5 "name": "Airport transition alert"
6 },
7 {
8 "id": "2169e8ea-a03d-43fb-9d2e-f0f5529b983f",
9 "name": "Train station transition alert"
10 },
11 {
12 "id": "821bd614-fbf1-4d66-8569-9ff34e92784f",
13 "name": "Bus station transition alert"
14 }
15 ],
16 "resultInfo": {
17 "maxResults": 3,
18 "pageNumber": 1,
19 "itemsCount": 5
20 }
21}