Update a Trigger:

PUT /triggers

Change the settings of an existing trigger.

Contents

See also:
Create a Trigger
Get Triggers
Delete a Trigger

Uses and Requirements

The triggerCategory cannot be changed. For example, you cannot change a trigger for SMS messages into one for data usage.

Note: If you change the existing criteria for a trigger, devices that already meet the new trigger criteria will not immediately trigger an alert. The next usage that meets the criteria will trigger an alert.

Request Components

HTTP Request

PUT https://thingspace.verizon.com/api/m2m/v1/triggers

Resource and Query Parameters

None.

Header Parameters

The request header must contain a current ThingSpace authorization bearer token and a valid VZ-M2M session token, and must set the content-type to JSON.

 

Parameter Name Data Type Description
Authorization
required
string HTTP Authorization bearer token.
VZ-M2M-Token
required
string A valid session token returned by POST /session/login.
Content-Type
required
string Must be application/json.

Request Body

The request body contains parameters to identify the trigger and the parameters that you want to change.

Parameter Name Data Type Description
triggerId
required
string The unique ID of the trigger that you want to change.
name
required
string The unique name of the trigger. Use the existing name if you do not want to change it.
accountName
required
string The Verizon billing account that the trigger belongs to. You cannot move a trigger to a different account.
groupName
required
string The name of a device group, if you want this trigger to only be active for devices in that group. Use the existing DeviceGroupName if you do not want to change the trigger to work with a different device group. If you do not specify a device group, the trigger will be active for all devices in the account.
triggerCategory
required
string Must be set to the current value of the type of usage that the trigger responds to:DeviceSMSUsage, DeviceDataUsage, DeviceSessionTime, or promoAlert. This value cannot be changed.
cycleType
required
string The accumulation cycle of the trigger, “Daily”, “Weekly”, or “Monthly”. Weekly cycles start on Monday, and monthly cycles are based on the account billing cycle.
smsTriggerRequest
required when triggerCategory == deviceSMSUsage
SmsTriggerRequest The details of the deviceSMSUsage trigger.
smsType
required for smsTriggerRequest
string The type of SMS messages that count toward the trigger criteria:
  • MO = Mobile-Originated (SMS messages sent by devices)
  • MT = Mobile-Terminated (SMS messages sent to devices)
  • MOMT = SMS messages sent by devices and to devices
threshold
required for smsTriggerRequest
string The number of smsType messages required to activate the trigger, based on the comparator.
comparator
required for smsTriggerRequest
string The type of comparison to be made between the number of smsType messages and threshold:

 

  • gt (greater than)
  • lt (less than)
dataTriggerRequest
required when triggerCategory == deviceDataUsage
DataTriggerRequest The details of the deviceDataUsage trigger.
threshold
required for smsTriggerRequest
string The amount of ThresholdUnit data required to activate the trigger, based on the comparator.
thresholdUnit
required for dataTriggerRequest
string Units to be used for counting data usage:
  • KB = Kilobytes
  • MB = Megabytes
  • GB = Gigabytes
comparator
required for dataTriggerRequest
string The type of comparison to be made between actual data usage and threshold:

 

  • gt (greater than)
  • lt (less than)
sessionTriggerRequest
required when triggerCategory == deviceSessionTime
SessionTriggerRequest The details of the deviceSessionTime trigger.
threshold
required for sessionTriggerRequest
string The number of seconds of session time required to activate the trigger, based on the comparator.
comparator
required for sessionTriggerRequest
string The type of comparison to be made between actual session duration and threshold:

 

  • lt (less than)
  • gt (greater than)
promoAlertTriggerRequest
required when triggerCategory == promoAlert
promoAlertTriggerRequest The details of the promoAlert trigger.
dataPercentage50
Boolean Set to "true" to set Trigger alerts when data usage percentage exceeds 50%.
dataPercentage75
Boolean Set to "true" to set Trigger alerts when data usage percentage exceeds 75%.
dataPercentage90
Boolean Set to "true" to set Trigger alerts when data usage percentage exceeds 90%.
smsPercentage50
Boolean Set to "true" to set Trigger alerts when sms usage percentage exceeds 50%.
smsPercentage75
Boolean Set to "true" to set Trigger alerts when sms usage percentage exceeds 75%.
smsPercentage90
Boolean Set to "true" to set Trigger alerts when sms usage percentage exceeds 90%.
noOfDaysB4PromoExp
integer The number of days before the promotion expires that you want to send the alert. To enable, set to a positive number larger than 0. To disable, set to 0 or a negative number.

Example Request Body

Update a data usage trigger for when a device uses more than 5 MB of data in a week.

{
    "triggerId":"2b3123d1-ba3c-4040-9272-a88cdf4650c9",
    "triggerName":"Data usage",
    "accountName":"1000012345-00001",
    "groupName":"NV trucks",
    "triggerCategory":"deviceDataUsage",
    "cycleType":"weekly",
    "dataTriggerRequest":{
        "threshold":"5",
        "thresholdUnit":"MB",
        "comparator":"gt"
    },
    "promoAlertTriggerRequest":{
        "dataPercentage50":false,
        "dataPercentage75":false,
        "dataPercentage90":false,
        "smsPercentage50":false,
        "smsPercentage75":false,
        "smsPercentage90":false,
        "noOfDaysB4PromoExp":30
    }
}



Success Responses

Status 200

A successful response returns the trigger ID. You can use the GET /triggers request to verify the changes.

Parameter Name Data Type Description
triggerId string The unique identifier of the trigger.

Example Success Response

{ "triggerId": "595f5c44-c31c-4552-8670-020a1545a84d", }

Failure Responses

Status 400

All error messages are returned in this format:

{ "errorCode": "error code string", "errorMessage": "error message string" }

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

Try It Out!