Update alert rule partially
Decommission notice
Purpose
This endpoint is used to partially update an Alert Rule.
Request data
HTTPS method: PATCH
- 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/{ruleId}?key={Your_API_Key}&adminKey={Your_Admin_Key}curl command request format
curl -XPATCH -d '{ "enabled": true}''https://{baseURL}/geofencing/{versionNumber}/alerts/rules/{ruleId}?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. |
| The UUID of the Alert Rule. |
| An API Key valid for the requested service. |
| An Admin Key valid for the provided API Key. |
PATCH request body
{ "enabled": true}Request fields
The following table describes the fields that can be used in a request body.
Primary fields | Description |
|---|---|
| The Boolean value that says if an Alert Rule is enabled or not.
Default value: |
Response data
Response body
{ "id": "The id of the alert rule", "name": "The name of the alert rule", "object": "The id of the object", "project": "The id of the project", "fence": "The id of the fence", "alertType": "Type of the alert", "alertRuleConstraints": { "key": "value" }, "notificationGroup": "The id of the notification group", "enabled": true}Response fields
The following table describes all of the fields that can appear in a response.
Primary fields | |
|---|---|
Field | Description |
| The UUID of the Alert Rule. |
| 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 Alert Rule.
|
| Contains information about a specific Alert Rule. |
| The UUID of the owned group in the Notification Service to send the Alert Rule. |
| The Boolean value that says if an Alert Rule is enabled or not.
|
alertRuleConstraints object | |
Field | Description |
| The type of the Transition to Alert.
This field exists for the |
| Maximum time (in seconds) an Object can stay inside a Fence before an
Alert is raised. |
| Maximum number of Ojects that can be present in a Fence at one time
before an Alert is raised. |
| Distance from the fence within which the alarm will be triggered. The
value is expressed in meters. |
| Side of the fence in which the proximity will be measured.
This field exists for the |
Response codes
Code | Meaning & possible causes |
|---|---|
| OK |
| Bad request:
|
| Forbidden:
|
Example
Partially update the Alert Rule
URL request example
https://api.tomtom.com/geofencing/1/alerts/rules/bf40406b-1d8d-4218-bcf2-e67b83063d02?key=nQRhDX5saL2KM0dIzEfeX2lcxWk9ktT2qXDZpwCr&adminKey=QekKaqqCHBpFLPCeViVSPATCH body request example
{ "enabled": false}Response body example
{ "id": "bf40406b-1d8d-4218-bcf2-e67b83063d02", "name": "Airport transition alert", "project": "47b10143-0b43-4803-a931-98cb1e595520", "fence": "*", "object": "fc94720b-23cd-4ddf-a560-00f8518e43c9", "alertType": "TRANSITION", "alertRuleConstraints": { "transitionType": "ALL" }, "notificationGroup": "358a3348-26d6-4d9d-8d5a-c3de41b26f63", "enabled": false}