Retrieve a Trigger Value for Anomaly Detection
# Retrieve a Trigger Value for Anomaly Detection ### `GET /v2/triggers/{triggerId}` Retrieving a trigger for anomaly detection is similar to updating any trigger in Connectivity Management. The only difference is a few new values added for Anomaly Detection. This page will cover the new values and provide examples of what requests look like with the new values. ## HTTP Request GET [https://thingspace.verizon.com/api/m2m/v2/triggers/{triggerId}](/docs/premium-apis/thingspace-intelligence/api-endpoints/anomaly-triggers-v2/listanomalydetectiontriggersettingsv2) ## Request Body | Parameter Name | Data Type | Description | |:-------------------|:---------|:--------------------------------------------------------------| | **triggerId** _(required)_ | string | This is the system assigned ID of the trigger being retrieved. | ## Response Parameters | Parameter Name | Data Type | Description | |:-----------------------------------------------------------------------------------------|:------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **triggers** | object | Trigger details | | **triggers.triggerId** | string | The system assigned name of the trigger being updated | | **triggers.triggerName** | string | The user defined name of the trigger | | **triggers.organizationName** | string | The user assigned name of the organization associated with the trigger | | **triggers.triggerCategory** | string | `UsageAnomaly` - This is the value to use in the request body to detect anomalous behaivior. The values in this table will only be relevant when this parameter is set to this value. | | **triggers.triggerAttributes** | object | additional details and keys for the trigger | | **triggers.triggerAttributes.key** | string | If present, the `NotificationGroupName` will be listed here | | **triggers.triggerAttributes.key** | string | T he `ServicePlan` name will be listed here | | **triggers.triggerAttributes.key** | boolean | DataPercentage50 <br> `True` - Trigger on Data percentage is over 50% used, `False` - Do not trigger when over 50% used. | | **triggers.triggerAttributes.key** | boolean | DataPercentage75 <br>`True` - Trigger on Data percentage is over 75% used, `False` - Do not trigger when over 75% used. | | **triggers.triggerAttributes.key** | boolean | DataPercentage90 <br> `True` - Trigger on Data percentage is over 90% used, `False` - Do not trigger when over 90% used. | | **triggers.triggerAttributes.key** | boolean | DataPercentage100 <br> `True` - Trigger on Data percentage is over 100% used, `False` - Do not trigger when over 100% used. | | **triggers.triggerAttributes.createdAt** | string (date-time) | Timestamp for whe the trigger was created. | | **triggers.triggerAttributes.modifiedAt** | string (date-time) | Timestamp for the most recent time the trigger was modified. | | **triggers.anomalyattributes** | object | The details of the `UsageAnomaly` trigger. | | **triggers.anomalyattributes.accountNames** <br> either accountNames or deviceGroup is displayed | string | The Verizon billing account associated with the anomaly triggers for this trigger to be active for devices in those accounts. An account name is usually numeric, and must include any leading zeros. | | **triggers.anomalyattributes.deviceGroups** <br> either accountNames or deviceGroup is displayed | string | The names of device groups associated with the anomaly triggers for this trigger to be active for devices in those groups. | | **triggers.anomalyattributes.includeAbnormal** | boolean | Whether or not to include anomalies classified as “abnormal". `true` or `false`. <br> Classification is set as part of ThingSpace Intelligence anomaly detection settings. | | **triggers.anomalyattributes.includeVeryAbnormal** | boolean | Whether or not to include anomalies classified as “very abnormal”. `true` or `false`. <br> Classification is set as part of ThingSpace Intelligence anomaly detection settings. | | **triggers.anomalyattributes.includeUnderExpectedUsage** | boolean | Whether or not to include anomalies that are directionally under the expected usage. `true` or `false`. <br> | | **triggers.anomalyattributes.includeOverExpectedUsage** | boolean | Whether or not to include anomalies that are directionally over the expected usage. `true` or `false`. <br> | | **triggers.notification** | object | The notification details of the trigger. | | **triggers.notification.notificationType** | string | The type of notification, i.e. "DailySummary". | | **triggers.notification.callback** | boolean | Whether or not the notification should be sent via callback. `true` or `false`. <br> | | **triggers.notification.emailNotification** | boolean | Whether or not the notification should be sent via e-mail. `true` or `false`. <br> | | **triggers.notification.notificationGroupName** | string | Name for the notification group | | **triggers.notification.notificationFrequencyFactor** | integer | how often notifications will occur once the threshold is met | | **triggers.notification.notificationFrequencyInterval** | integer | How much time between notifications | | **triggers.notification.externalEmailRecipients** | string | E-mail address(es) where the notification should be delivered. | | **triggers.notification.smsNotification** | boolean | If notifications will be sent out as SMS messages to cellphones. <br> `True` - SMS messages will be sent, `False` - SMS messages will not be sent. | | **triggers.notification.smsNumbers** | string | A comma seperated list of 10-digit cellphone numbers to send notifications to. | | **triggers.notification.reminder** | boolean | If a daily reminder from the trigger will be sent regardless of the threshold being met or not. <br> `True` - Send a daily reminder, `False` - No reminder will be sent. | | **triggers.notification.severity** | string | Severity level associated with the notification. Examples would be: `Major`, `Minor`, `Critical`, `NotApplicable`. | ## Success Responses SA successful request will return a trigger ID to identify the request in a callback. For more information about callbacks, please visit [About Callback Services](https://thingspace.verizon.com/documentation/api-documentation.html#/http/connectivity-management/guides/working-with-verizon-wireless/about-callback-services) Status 200 ``` json { "triggers": [ { "triggerId": "BE1B5958-3E11-41DB-9ABD-B1B7618C0035", "triggerName": "Anomaly Daily Usage REST Test-1", "organizationName": "AnamolyDetectionRTRTest", "triggerCategory": "UsageAnomaly", "triggerAttributes": [ { "key": "NotificationGroupName" }, { "key": "ServicePlan" }, { "key": "DataPercentage50", "value": "False" }, { "key": "DataPercentage75", "value": "False" }, { "key": "DataPercentage90", "value": "False" }, { "key": "DataPercentage100", "value": "False" } ], "createdAt": "2021-10-21T23:57:003.397Z", "modifiedAt": "2021-10-21T23:57:003.397Z", "anomalyAttributes": { "accountNames": [ "0000123456-00001" ], "deviceGroup": "User Group 1", "includeAbnormal": true, "includeVeryAbnormal": true, "includeUnderExpectedUsage": true, "includeOverExpectedUsage": true }, "notification": { "notificationType": "DailySummary", "callback": true, "emailNotification": true, "notificationGroupName": "Anomaly Test API", "notificationFrequencyFactor": -2147483648, "externalEmailRecipients": "placeholder@verizon.com", "smsNotification": true, "smsNumbers": "10-digit cellphone number", "reminder": false, "severity": "Critical" } } ] } ``` ## Failure Responses All error messages are returned in this format: ``` json { "errorCode": "error code string", "errorMessage": "error message string" } ```