CreateTrigger

Create a new trigger that will send a callback notification based on specified device usage.

Uses and Requirements

When a trigger's condition is met, a notification will be sent as a callback message. The account must be registered for AlertService callbacks to receive these notifications.

Request Parameters

Parameter Type Description
TriggerName
required
string A unique name for this trigger.
AccountName
required
string The Verizon billing account that the trigger will belong to. An account name is usually numeric, and must include any leading zeros.
DeviceGroupName
optional
string The name of a device group, if you want this trigger to only be active for devices in that group. If you do not specify a device group, the trigger will be active for all devices in the account.
TriggerCategory
required
string

The type of usage that the trigger responds to. Valid value are:

  • AggregateDeviceDataUsage - The sum of all data usage for all devices on an account.
  • DeviceIMEIChange - The device IMEI change.
  • 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
CycleType
required when TriggerCategory = DeviceSmsUsage or DeviceDataUsage
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.
SmsTrigger
required when TriggerCategory = DeviceSmsUsage
SmsTriggerRequest The details of the DeviceSmsUsage trigger.
SmsType
required for SmsTrigger
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
Comparator
required for SmsTrigger
string

The type of comparison to be made between the number of SmsType messages and Threshold:

  • lt (less than)
  • lte (less than or equal to)
  • gt (greater than)
  • gte (greater than or equal to)
Threshold required for SmsTrigger integer The number of SmsType messages required to activate the trigger, based on the Comparator.
DataTrigger
required when TriggerCategory = DeviceDataUsage
DataTriggerRequest

The details of the DeviceDataUsage trigger.

Note that 4G device data usage is only recorded at the end of each session.

Threshold required for DataTriggerRequest integer 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:

  • MB = Megabytes
  • KB = Kilobytes
  • GB = Gigabytes
  • TB = Terabytes
Comparator
required for DataTriggerRequest
string

The type of comparison to be made between actual data usage and Threshold:

  • lt (less than)
  • lte (less than or equal to)
  • gt (greater than)
  • gte (greater than or equal to)
SessionTrigger
required when TriggerCategory = DeviceSessionTime
SessionTriggerRequest The details of the DeviceSessionTime trigger.
Comparator
required for SessionTriggerRequest
string

The type of comparison to be made between actual session duration and Threshold:

  • lt (less than)
  • gt (greater than)
Threshold
required for SessionTriggerRequest
integer The number of seconds of session time required to activate the trigger, based on the Comparator.

Response Parameters

Parameter Type Description
TriggerId string A unique identifier for the new trigger. You must use this ID when making changes or deleting the trigger. All callbacks sent by this trigger will contain this triggerId.

Example SOAP Request

Create an SMS trigger for when a device sends more than 50 SMS messages in a day.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://nphase.com/unifiedwebservice/v2" xmlns:nph="<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://nphase.com/unifiedwebservice/v2" xmlns:nph="http://schemas.datacontract.org/2004/07/NPhase.UnifiedWebService.APIs.v2.Contract.TriggerService">
  <soapenv:Header>
    <token xmlns="http://nphase.com/unifiedwebservice/v2">bca5f9c5-3d0d-4c14-b9f9-7310f5879ad7</token>
  </soapenv:Header>
  <soapenv:Body>
    <v2:CreateTrigger>
      <v2:Input>
        <nph:TriggerName>SMS 50 per day</nph:TriggerName>
        <nph:AccountName>0242076543-00001</nph:AccountName>
        <nph:DeviceGroupName/>
        <nph:TriggerCategory>DeviceSmsUsage</nph:TriggerCategory>
        <nph:CycleType>DAILY</nph:CycleType>
        <nph:SmsTrigger>
          <nph:SmsType>MO</nph:SmsType>
          <nph:Comparator>gt</nph:Comparator>
          <nph:Threshold>50</nph:Threshold>
        </nph:SmsTrigger>
      </v2:Input>
    </v2:CreateTrigger>
  </soapenv:Body>
</soapenv:Envelope>

Example SOAP Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <CreateTriggerResponse xmlns="http://nphase.com/unifiedwebservice/v2">
      <Output xmlns:a="http://schemas.datacontract.org/2004/07/NPhase.UnifiedWebService.APIs.v2.Contract.TriggerService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <a:TriggerId>3E22E96B-F888-4889-A2D7-7119496A0C5F</a:TriggerId>
      </Output>
    </CreateTriggerResponse>
  </s:Body>
</s:Envelope>

Example Callback Messages

SMS Usage Callback Notification

This notification identifies the trigger that sent the notification, the definition of the trigger, the device that met the criteria, and the timestamp of when the criteria was met.

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <CallbackRequest xmlns="http://nphase.com/unifiedwebservice/v2">
      <Username></Username>
      <Password></Password>
      <RequestId>994531BC-2188-42D2-82F4-469B3A37AFD4</RequestId>
      <Data>
        <Data xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <CarrierService xsi:nil="true"/>
          <ExternalProvisioningChange xsi:nil="true"/>
          <PromoChange xsi:nil="true"/>
          <SMSDelivery xsi:nil="true"/>
          <PRLInformation xsi:nil="true"/>
          <DeviceService xsi:nil="true"/>
          <GoToState xsi:nil="true"/>
          <DeviceProfileService xsi:nil="true"/>
          <AlertService>
            <TriggerId>CBF9F79D-FF4B-4E4F-9068-0492CC4FB070</TriggerId>
            <TriggerName>FromUWSSessionTimeTest01</TriggerName>
            <DeviceIdentifierCollection>
              <Kind>Mdn</Kind>
              <Identifier>2390986798</Identifier>
            </DeviceIdentifierCollection>
            <TriggerDateTime>3/21/2018 11:15:53 PM</TriggerDateTime>
            <TriggerValue>11</TriggerValue>
            <CycleType xsi:nil="true">WEEKLY</CycleType>
            <SmsType xsi:nil="true">MOMT</SmsType>
            <Threshold>10</Threshold>
            <ThresholdUnit xsi:nil="true"/>
            <Message xsi:nil="true">SMS Usage</Message>
          </AlertService>
          <Fault xsi:nil="true"/>
          <Comment xsi:nil="true"/>
          <Summary xsi:nil="true"/>
          <Status xsi:nil="true"/>
          <CallbackCount>1</CallbackCount>
          <MaxCallbackThreshold>4</MaxCallbackThreshold>
          <ExtendedEnhancedConnectivityService xsi:nil="true"/>
        </Data>
      </Data>
    </CallbackRequest>
  </s:Body>
</s:Envelope>

Session Connection Time Callback Notification

This notification identifies the trigger that sent the notification, the definition of the trigger, the device that met the critieria, and the timestamp of when the criteria was met.

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <CallbackRequest xmlns="http://nphase.com/unifiedwebservice/v2">
      <Username></Username>
      <Password></Password>
      <RequestId>994531BC-2188-42D2-82F4-469B3A37AFD4</RequestId>
      <Data>
        <Data xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <CarrierService xsi:nil="true"/>
          <ExternalProvisioningChange xsi:nil="true"/>
          <PromoChange xsi:nil="true"/>
          <SMSDelivery xsi:nil="true"/>
          <PRLInformation xsi:nil="true"/>
          <DeviceService xsi:nil="true"/>
          <GoToState xsi:nil="true"/>
          <DeviceProfileService xsi:nil="true"/>
          <AlertService>
            <TriggerId>CBF9F79D-FF4B-4E4F-9068-0492CC4FB070</TriggerId>
            <TriggerName>FromUWSSessionTimeTest01</TriggerName>
            <DeviceIdentifierCollection>
              <Kind>Mdn</Kind>
              <Identifier>2390986798</Identifier>
            </DeviceIdentifierCollection>
            <TriggerDateTime>3/21/2018 11:15:53 PM</TriggerDateTime>
            <TriggerValue>510</TriggerValue>
            <CycleType xsi:nil="true"/>
            <SmsType xsi:nil="true"/>
            <Threshold>500</Threshold>
            <ThresholdUnit xsi:nil="true"/>
            <Message xsi:nil="true"/>
          </AlertService>
          <Fault xsi:nil="true"/>
          <Comment xsi:nil="true"/>
          <Summary xsi:nil="true"/>
          <Status xsi:nil="true"/>
          <CallbackCount>1</CallbackCount>
          <MaxCallbackThreshold>4</MaxCallbackThreshold>
          <ExtendedEnhancedConnectivityService xsi:nil="true"/>
        </Data>
      </Data>
    </CallbackRequest>
  </s:Body>
</s:Envelope>

Request Schema Diagram

Response Schema Diagram