Create transition alert rule
Decommission notice
Deprecation notice
Purpose
This endpoint is used to configure a Transition Alert Rule.
Request data
HTTPS method: POST
- 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 format
https://{baseURL}/geofencing/{versionNumber}/alerts/transitions?key={Your_API_Key}&adminKey={Your_Admin_Key}curl command format
curl -v -XPOST -H "Content-type: application/json" -d'{ "name": "{Enter name of created alert rule}", "object": "{Enter id of watched object}", "project": "(Enter id of watched project}", "fence": "{Enter id of watched fence}", "transitionType": "ALL", "notificationGroup": "{Enter id of your notification group}", "enabled": true }''https://{baseURL}/geofencing/{versionNumber}/alerts/transitions?key={Your_API_Key}&adminKey={Your_Admin_Key}'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.
Note: There are no optional parameters in this endpoint.
Required parameters | Description |
|---|---|
| The base URL for calling the API. |
| Service version. |
| An API Key valid for the requested service. |
| An Admin Key valid for the provided API Key. |
POST request body
{ "name": "Enter name of created alert rule", "object": "Enter id of watched object", "project": "Enter id of watched project", "fence": "Enter id of watched fence", "transitionType": "ALL", "notificationGroup": "Enter the id of your notification group", "enabled": true}Request fields
The following table describes the fields that can be used in a request body.
Primary fields | Description |
|---|---|
| The name of the alert rule. |
| The UUID of the object or |
| The UUID of the project or |
| The UUID of the fence or |
| The type of the transition to alert.
|
| The UUID of the owned group in the Notification Service to send an alert. |
| The Boolean value that says if an alert rule is enabled or not.
Field is not required. |
Response data
Response body
{ "id": "Id of created alert rule", "covers": [ "Id of covered other alert rule", "Id of covered other different alert rule" ]}Response fields
The following table describes all of the fields that can appear in a response.
Primary fields | Description |
|---|---|
| The UUID of the alert rule. |
| The list of UUID alerts covered by the already created alert rules. |
Response codes
Code | Meaning & possible causes |
|---|---|
| Created |
| Bad request:
|
| Forbidden:
|
Example
Create a new transition alert rule.
Request format
https://api.tomtom.com/geofencing/1/alerts/transitions?key=PJD7y0G5AFj9Jiok6F0tIK16NiWYotb3&adminKey=b330d317-4fe1-4d48-b75f-06cc3be58fb2POST body format
{ "name": "Airport transition alert rule", "object": "*", "project": "ab550513-7026-4c98-9ff7-a930d70b66f8", "fence": "0b16633b-7b2b-4fd6-a834-f36c2250ab66", "transitionType": "ALL", "notificationGroup": "8e34613a-2324-4749-ac9d-25bf7a91d218", "enabled": true}Response body
{ "id": "1f9e811f-867b-4d4d-aed9-7d8266fac0ae", "covers": [ "e4f06777-079e-4f02-a49d-97dd4c4e3a81", "c930bae3-98c8-4c07-93e6-f01ca1c3134a" ]}