Standard APIsRules Engine 2.0API Reference

Create a Price Plan Trigger (pay as you go)

POST /v2/triggers

Create a new trigger to send an alert based on Pay As You Go price plan usage. The trigger may also suspend usage or change the service plan of specified devices.

Header Parameters

The request header must set the content-type to JSON, contain a current ThingSpace authorization token and a current VZ-M2M session token. For more details on how to get these tokens, visit Getting Started.

Parameter NameData TypeDescription
Authorization (required)stringHTTP Authorization bearer token: Authorization: Bearer {token}
VZ-M2M-Token (required)stringA valid session token: VZ-M2M-Token: {M2Mtoken}
Content-Type (required)stringMust be application/json Content-Type: application/json

HTTP Request

POST https://thingspace.verizon.com/api/m2m/v2/triggers

Note: Please use the indicated drop down value in the Code Playground for the JSON listed

Request Parameters

The request body specifies the information about the Pay As You Go price plan usage trigger that you want to create. Please note that all parameters are required unless marked optional

Parameter NameData TypeDescription
triggerNamestringThe user defined name of the trigger.
ecpdIdstringThe Enterprise Customer Profile Database ID (ECPD ID), also known as the Verizon profile ID.
triggerCategoryobjectThe category of trigger being created. For these requests the category is pricePlanDataUsage.
pricePlanTriggerobjectThe parameters and actions of the trigger.
payAsYouGoobjectDetails of the Pay as you Go price plan trigger
filterCriteriaobjectDefines separate (individual device or group) or combined (all groups or devices on the account) and the account names associated.
carrierServicePlanCodeintegerThe Service Plan ID.
accountNameListarrayan array of accountName values using the service plan that the trigger will act upon.
conditionobjectDefines the trigger condition to monitor for notification.
conditionType (optional)stringThe condition type defines how the trigger will evaluate the usage:
Individual - Per Device, with respect to defined threshold
AccountLevel - Aggregated per account, with respect to defined threshold
UsageAllowance - Per Account, with respect to the plan pool allowance
Aging - rather than usage, trigger will be activated based on how long a device has been on the specified plan.
Note: If this field is left blank, the conditionType will be "Individual"
comparator (optional)stringThe type of comparison to be made against the threshold. The point reached relative to the threshold that the trigger activates:
gt - Greater Than,
lt - Less Than,
eq - Equal To
Required for "Individual" and "AccountLevel" conditionTypes.
threshold (optional)integerThe number of units defining the threshold. Required for "Individual" and "AccountLevel" conditionTypes.
cycleType (optional)stringThe accumulation cycle of the trigger.
Required for "Individual" and "AccountLevel" conditionTypes: Daily, Weekly or Monthly.
Weekly cycles start on Monday and monthly cycles are based on the account billing cycle. Default is Daily.
separateOrCombined (optional)stringOnly applicable for the "AccountLevel" conditionType. Determines whether or not to aggregate usage of multiple accounts together or separate by account: Separate or Combined.
percentage50
percentage75
percentage90
percentage100
booleanIndicates whether the trigger should be activated when usage reaches the specified percentage of the plan allowance:
true - trigger should be activated at percentage threshold
false - trigger should not be activated at percentage threshold.
actionobjectWhen the trigger activates, this is the action taken.
suspend (optional)booleanSuspend the devices / account from further usage:
true - suspend devices when trigger is activated, account suspended
false - do not suspend devices when trigger is activated, account not suspended.
Note: Suspend and changePlan cannot both be true.
suspendDetailsobjectsuspendDetails is required if the suspend boolean is true.
suspendFromAccountsarrayAn array of accountNames to suspend from usage.
suspendDurationstringNumber of days to suspend service: 30, 60, 90 or NextBillCycle.
suspendOptionstringWithBilling or WithoutBilling. This option depends on the service plan.
threshold (optional)integerThe number of units that cause suspension. Required if suspend is true and conditionType is "AccountLevel".
thresholdUnit (optional)stringThe units the threshold is measured in:
KB - Kilobits,
MB - Megabits,
GB - Gigabits,
TB - Terabits.
Required if suspend is true and conditionType is "AccountLevel".
changePlan (optional)booleanChanges the plan of the device upon activation of the trigger:
true - change plan when trigger is activated
false - do not change plan when trigger is activated.
Note: Suspend and changePlan cannot both be true.
changePlanDetailsobjectchangePlanDetails is required if changePlan boolean is true and conditionType is "Individual".
toCarrierServicePlanCodestringThe service plan ID to change the plan of the device to.
agingDetails (optional)objectagingDetails is required if conditionType is Aging.
onNumberOfBillCycleintegerThe number of bill cycles that a device can be on the price plan before an alert is sent.
toCarrierServicePlanCode (optional)stringThe service plan ID to change the plan of the device to. Required if changePlan is true.
notificationobjectDefines the type and frequency of notification.
notificationTypestringThis will be PerEvent or DailySummary.
callbackbooleanIndicates if a callback will be generated by the notification or not:
true - A callback is generated
false - A callback will not be generated.
emailNotification (optional)booleanIndicates if the notification will send an email or not:
true - notification generates an email
false - notification does not generate an email
notificationGroupName (optional)stringA user defined name for a group to notify.
notificationFequencyFactorintegerThe number of reminder notifications to send after the trigger is activated.
notificationFrequencyIntervalstringThe frequency of the reminder notifications. Hourly, Daily or Weekly.
externalEmailRecipients (optional)stringA comma separated list of email addresses to notify if Email notification is used.
smsNotification (optional)booleanIndicates if a notification Short Messaging Service (SMS) message will be sent:
true - a text message (sms) will be sent
false - a text message will not be sent
smsNumbersarrayAn array of mobile numbers to send text messages to if smsNotification is true.
numberstringThe 10-digit mobile number to send an SMS message to.
carrierstringThe service provider for that mobile number.
reminderbooleanIf a reminder will be sent at the defined intervals:
true - A reminder is sent
false - A reminder is not sent.
severitystringThe severity associated with the notification: Notice, Minor, Major or Critical.
activebooleanIndicates the trigger is active or not:
true - trigger is active
false - trigger is not active

Request Body

Example Request Body using the dropdown for "Create a Price Plan Trigger (pay as you go)":

{
    "triggerName": "user assigned trigger name",
    "ecpdId": "Verizon profile ID",
    "triggerCategory": "PricePlanDataUsage",
    "pricePlanTrigger": {
        "payAsYouGo": {
            "filterCriteria": {
                "carrierServicePlanCode": "Service plan code value",
                "accountNameList": [
                    "0000123456-00001"
                ]
            },
            "condition": {
                "conditionType": "Individual",
                "comparator": "gt",
                "threshold": 100,
                "thresholdUnit": "KB",
                "cycleType": "Daily"
            },
            "action": {
                "changePlan": true,
                "changePlanDetails": {
                    "toCarrierServicePlanCode": "Destination service plan code value"
                }
            }
        }
    },
    "notification": {
        "notificationType": "PerEvent",
        "callback": true,
        "emailNotification": false,
        "notificationGroupName": "NotificationGroupName",
        "notificationFrequencyFactor": 3,
        "notificationFrequencyInterval": "Daily",
        "externalEmailRecipients": "ExternalEmailRecipients",
        "smsNotification": true,
        "smsNumbers": [
            {
                "number": "10-digit mobile number",
                "carrier": "mobile service provider"
            },
            {
                "number": "10-digit mobile number",
                "carrier": "mobile service provider"
            }
        ],
        "reminder": true,
        "severity": "Critical"
    },
    "active": true
}

Example Request Body using the dropdown for "Create a Price Plan Trigger with Aging (pay as you go)":

{
    "triggerName": "user assigned trigger name",
    "ecpdId": "Verizon profile ID",
    "triggerCategory": "PricePlanDataUsage",
    "pricePlanTrigger": {
        "payAsYouGo": {
            "filterCriteria": {
                "carrierServicePlanCode": "Service plan code value",
                "accountNameList": [
                    "0000123456-00001"
                ]
            },
            "condition": {
                "conditionType": "Aging"
            },
            "action": {
                "changePlan": true,
                "agingDetails": {
                    "onNumberOfBillCycle": 2,
                    "toCarrierServicePlanCode": "Destination service plan code value"
                }
            }
        }
    },
    "notification": {
        "notificationType": "PerEvent",
        "callback": true,
        "emailNotification": false,
        "notificationGroupName": "NotificationGroupName",
        "notificationFrequencyFactor": 3,
        "notificationFrequencyInterval": "Daily",
        "externalEmailRecipients": "ExternalEmailRecipients",
        "smsNotification": true,
        "smsNumbers": [
            {
                "number": "10-digit mobile number",
                "carrier": "mobile service provider"
            },
            {
                "number": "10-digit mobile number",
                "carrier": "mobile service provider"
            }
        ],
        "reminder": true,
        "severity": "Critical"
    },
    "active": true
}

Success Responses

Status 200

Example Success Response:

{
  "triggerId": "b9cc1da6-ffff-eeee-gggg-7eba8859ab5e"
}

Failure Responses

All error messages are returned in this format:

{
  "error": "error code string",
  "error_description": "error message string",
}

Error codes and messages are listed on the Error Messages page, along with explanations and suggestions for corrective actions.

Callback Response

These endpoints send responses asynchronously. In order to read the results a callback is required. To learn more about callbacks, please visit About Callback Services.

Example callback response:

{
    "username": "user making the request",
    "password": "user's password",
    "requestId": "system generated request ID",
    "deviceResponse": {
        "alertServiceResponse": {
            "triggerId": "b9cc1da6-89d8-4b52-b91a-7eba8859ab5e",
            "triggerName": "user assigned trigger name",
            "triggerCategory": "PricePlanDataUsage",
            "accountName": "0000123456-00001",
            "payAsYouGo": {
                "carrierServicePlanCode": "sevice plan code value",
                "servicePlanDescription": "description of the service plan",
                "deviceIds": [
                    {
                        "id": "15-digit IMEI",
                        "kind": "IMEI"
                    }
                ],
                "triggerDateTime": "2022-04-13T00:07:54.7410000Z",
                "triggerValue": 2,
                "cycleType": "DAILY",
                "threshold": 1,
                "thresholdUnit": "KB",
                "message": "Usage in KB > 1.00 KBDAILY (Usage in KB = 2.00 on device {device ID})"
            }
        }
    },
    "callbackCount": 1,
    "maxCallbackThreshold": 4
}

Callback Parameters

Parameter NameData TypeDescription
usernamestringThe name of the user making the request.
passwordstringThe user's password.
requestIdstringSystem generated UUID of the request being made.
deviceResponseobjectAll of the trigger information details.
alertServiceResponseobjectAll of the trigger information details returned by the responding device(s).
triggerIdstringThe trigger ID being queried.
triggerNamestringThe user assigned name of the trigger.
triggerCategorystringPrice plan triggers will always have the type PricePlanDataUsage.
accountNamestringThe billing ID. Account names are numeric and must include the leading zeros.
accountShareobjectDetails about the account share Trigger.
carrierServicePlanCodestringThe service plan ID.
servicePlanDescriptionstringA short description of the service plan.
deviceIdsarrayAn array of device ID objects associated with the trigger.
idstringThe device's ID value.
kindstringThe type of ID. Valid types include:
IMEI (International Mobile Equipment Identifier)
MSISDN (Mobile Station Integrated Services Digital Network)
MDN (Mobile Device Number).
triggerDateTimestring($date-time)The date and time that the trigger was activated.
triggerValueintegerThe value for when the trigger activates as set by the threshold.
cycleTypestringThe accumulation cycle of the trigger, for “Individual” and “AccountLevel” conditionTypes: Daily, Weekly and Monthly.
Weekly cycles start on Monday and monthly cycles are based on the account billing cycle.
thresholdintegerThe number of units measured as a threshold for the trigger.
thresholdUnitsstringThe units the threshold is measured in:
KB - Kilobits,
MB - Megabits,
GB - Gigabits and
TB - Terabits.
messagestringA message to be sent once the trigger activates.
callbackCountintegerThe number of callbacks returned from the request.
maxCallbackThresholdintegerThe maximum number of callbacks allowed per request.

On this page