Standard APIsConnectivity ManagementGuidesUses and Requirements

Update a Trigger

Update 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 NameData TypeDescription
Authorization requiredstringHTTP Authorization bearer token.
VZ-M2M-Token requiredstringA valid session token returned by POST /session/login.
Content-Type requiredstringMust be application/json.

Request Body

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

Parameter NameData TypeDescription
triggerId requiredstringThe unique ID of the trigger that you want to change.
name requiredstringThe unique name of the trigger. Use the existing name if you do not want to change it.
accountName requiredstringThe Verizon billing account that the trigger belongs to. You cannot move a trigger to a different account.
groupName requiredstringThe 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 requiredstringMust be set to the current value of the type of usage that the trigger responds to:DeviceSMSUsage, DeviceDataUsage, or DeviceSessionTime. This value cannot be changed.
cycleType requiredstringThe 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 == deviceSMSUsageSmsTriggerRequestThe details of the deviceSMSUsage trigger.
smsType required for smsTriggerRequeststringThe 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 smsTriggerRequeststringThe number of smsType messages required to activate the trigger, based on the comparator.
comparator required for smsTriggerRequeststringThe type of comparison to be made between the number of smsType messages and threshold: gt (greater than) lt (less than)
dataTriggerRequest required when triggerCategory == deviceDataUsageDataTriggerRequestThe details of the deviceDataUsage trigger.
threshold required for smsTriggerRequeststringThe amount of ThresholdUnit data required to activate the trigger, based on the comparator.
thresholdUnit required for dataTriggerRequeststringUnits to be used for counting data usage: KB = Kilobytes MB = Megabytes GB = Gigabytes
comparator required for dataTriggerRequeststringThe type of comparison to be made between actual data usage and threshold: gt (greater than) lt (less than)
sessionTriggerRequest required when triggerCategory == deviceSessionTimeSessionTriggerRequestThe details of the deviceSessionTime trigger.
threshold required for sessionTriggerRequeststringThe number of seconds of session time required to activate the trigger, based on the comparator.
comparator required for sessionTriggerRequeststringThe type of comparison to be made between actual session duration and threshold: lt (less than) gt (greater than)

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" } }

Success Responses

Status 200

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

Parameter NameData TypeDescription
triggerIdstringThe 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.

On this page