Get Triggers

Get Trigger Details:

GET /triggers
GET /triggers/{triggerId}
GET /accounts/{accountname}/triggers

Retrieve trigger information about:

  • all triggers that the current user has access to, which may include multiple accounts
  • a specified trigger
  • all triggers in a given account

Contents

See also:
Create a Trigger
Update a Trigger
Delete a Trigger

Request Components

HTTP Request

GET https://thingspace.verizon.com/api/m2m/v1/triggers
GET https://thingspace.verizon.com/api/m2m/v1/triggers/{triggerId}
GET https://thingspace.verizon.com/api/m2m/v1/accounts/{accountname}/triggers

Resource and Query Parameters

Use GET /triggers to get all triggers that you have access to, or specify a trigger ID to get a single trigger. User GET /accounts/{accountname}/triggers to get all triggers in an account.

Parameter Name Data Type Description
triggerId
optional
string The UUID of a specific trigger to get information about that trigger. If the request does not include a triggerId, the response will include all triggers that the current user has access to.
accountname
optional
string A Verizon billing account name, to retrieve all triggers that belong to that account. An account name is usually numeric, and must include any leading zeros.

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

None.

Success Responses

A success response includes a triggers array that contains all triggers that matched the request.

Status 200

Parameter Name Data Type Description
triggers array A trigger object for each trigger that matched the request.
triggerId string The unique ID of the trigger.
triggerName string Non-unique name of the trigger.
accountName string The name of the account that the trigger belongs to.
organizationName string The name of the organization that the account is part of.
groupName string The name of a device group if the trigger is only active for devices in that group. “All Devices” if the trigger is active for all devices in the account.
notificationGroupName string Null for triggers created with a POST /triggers request. The name of a notification group for triggers created in the ThingSpace portal.
triggerCategory string The type of usage that the trigger responds to:
  • DeviceSmsUsage - The number of SMS (text) messages sent by and/or to a device
  • DeviceDataUsage - The amount of data sent by a device
  • DeviceSessionTime - The duration of session connections
triggerCycle string For DeviceSmsUsage and DeviceDataUsage triggers, 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.
smsType string For DeviceSmsUsage triggers, the type of SMS messages that count toward the trigger criteria. Null for other trigger types.
  • 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
comparator string The type of comparison to be made between the device usage and threshold:
  • lt (less than)
  • lte (less than or equal to)
  • gt (greater than)
  • gte (greater than or equal to)
threshold string The amount of usage (SMS messages, data usage, seconds of session connection) required to activate the trigger, based on the Comparator.
thresholdUnit string For DeviceDataUsage triggers, the units to be used for counting data usage:
  • MB = Megabytes
  • KB = Kilobytes
  • GB = Gigabytes
createdAt dateTime The date and time that the trigger was created.
modifiedAt dateTime The date and time that the trigger was last modified.

Example Success Response

{
  "triggers":[
    {
      "triggerId":"BA845545-A21B-43AA-8998-1902F1381BA6",
      "triggerName":"MO SMS Trigger",
      "accountName":"0212345678-00001",
      "organizationName":"Nay Heavy Industries",
      "groupName":"All Devices",
      "notificationGroupName":"",
      "triggerCategory":"DeviceSMSUsage",
      "triggerCycle":"WEEKLY",
      "smsType":"MO",
      "comparator":"gt",
      "threshold":"100",
      "createdAt":"2018-03-02T17:51:13-05:00",
      "modifiedAt":"2018-03-02T17:51:13-05:00"
    },
    {
      "triggerId":"BA845545-A21B-43AA-8998-1902F1381BA6",
      "triggerName":"Long Session Trigger",
      "accountName":"0212345678-00001",
      "organizationName":"Nay Heavy Industries",
      "groupName":"All Devices",
      "notificationGroupName":"",
      "triggerCategory":"DeviceSessiontime",
      "comparator":"gt",
      "threshold":"120",
      "createdAt":"2018-03-02T17:51:13-05:00",
      "modifiedAt":"2018-03-02T17:51:13-05:00"
    },
    {
      "triggerId":"03B0B1DF-B059-4836-8A9C-D8D6B0C9330B",
      "triggerName":"Heavy Data Usage Trigger",
      "accountName":"0212345678-00001",
      "organizationName":"Nay Heavy Industries",
      "groupName":"All Devices",
      "notificationGroupName":"",
      "triggerCategory":"DeviceDataUsage",
      "triggerCycle":"MONTHLY",
      "comparator":"gt",
      "threshold":"100",
      "thresholdUnit":"MB",
      "createdAt":"2018-03-02T17:51:13-05:00",
      "modifiedAt":"2018-03-02T17:51:13-05:00"
    }
  ]
}

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!