List alert rules
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
https://{baseURL}/geofencing/{versionNumber}/alerts/rules?key={Your_API_Key}&project={uuid}&fence={uuid}&object={uuid}&alertType={string}&enabled={boolean}¬ificationGroup={uuid}&maxResults={integer}&pageNumber={integer}
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}¬ificationGroup={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 |
---|---|
| The base URL for calling the API. |
| Service version. |
| An API Key valid for the requested service. |
Optional parameters | Description |
---|---|
| UUID of a Project to filter by the specified UUID. |
| UUID of a Fence to filter by the specified UUID. |
| UUID of a Object to filter by the specified UUID. |
| Type of the Alert to filter by. |
| Select Rules by enabled or disabled. |
| UUID of a Notification Group to filter by the specified UUID. |
| Maximum number of items returned in the response. |
| 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. |
Response data
Response body
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_results12 }13}
Response fields
The following table describes all of the fields that can appear in a response.
Primary fields | |
---|---|
Field | Description |
| Array of configured Alerts for Fences with Objects. |
| Contains information about response paging. |
alertsRules array | |
Field | Description |
| The UUID of the Alert Rule. |
| The name of the Alert Rule. |
resultInfo object | |
Field | Description |
| Maximum number of items returned in the response. |
| Number of the items page to be returned in the response. Maximum number of elements on the page is equal to the maxResults value. |
| Number of returned items on the page. |
Response codes
Code | Meaning & possible causes |
---|---|
| OK |
| 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
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
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": 520 }21}