GetAggregateDeviceUsage

Returns the total amount of data sent and the total number of SMS messages sent or received by devices in a specified timeframe. The information is returned in a callback response, so you must register a URL endpoint to receive DeviceUsage callback messages using the Register Callback API in the Callback Registration Service.

Uses and Requirements

About Data Usage Calculations

The M2M Platform calculates three types of usage data: data usage, SMS usage, and rated usage. These usage data types originate from the following sources:

There is no date range limit for the Device Usage Report. However, in accordance with Verizon Data Retention Policy, the records contained in this report are kept for 12 months. Though you may specify any date range, you will not receive results for records that are older than 12 months.

Request Parameters

Parameter Type Description
DeviceList
optional*
DeviceIdentifier A list of one or more devices for which you want usage data.

You cannot use DeviceGroupName if you use DeviceList. You can use GetDeviceList to get a list of all devices in the account.

Kind
required for DeviceList
string The type of the device identifier. Valid types of identifiers are:

  • ESN (decimal)
  • ICCID (up to 20 digits)
  • IMEI (up to 15 digits)
  • MDN
  • MEID (hexadecimal)
  • MSISDN
Identifier
required for DeviceList
string The value of the device identifier.
DeviceGroupName
optional*
string The device group for which you want usage data.
AccountName
optional*
string

The AccountName element has two uses:

  • To retrieve the aggregate device usage for all devices associated in the account, specify the AccountName without specifying either DeviceList or DeviceGroupName.
  • To retrieve the aggregate device usage for all devices in a device group, you must specify an AccountName along with a DeviceGroupName.
TimestampFilter
required
TimeRange The time period for which you want usage data, specified as a Start and End dateTime. Start cannot be more than 6 months before the current date, and there cannot be more than one month between Start and End.
Start
required for TimestampFilter
dateTime The beginning of the reporting period. Cannot be more than 6 months before the current date.
End
required for TimestampFilter
dateTime The end of the reporting period. Cannot be more than 1 month from the Start date.

* You can either specify up to 10,000 individual devices with the DeviceList parameter, or you can run the request on all devices in an account or device group.

Response Parameters

Parameter Type Description
RequestId string

A unique string that associates the request with the results that are sent via a callback service.

The callback message will contain the information for all devices that match the request criteria. If there are a large number of results, the response will be split into multiple callbacks. Those will be followed by a final callback message indicating that the request has been completed. All of the callback messages will have the same RequestId.

Callback Response Parameters

Parameter Type Description
CallbackRequest CallbackRequest Wrapper element for all callback elements.
Username string The username defined when a URL was registered for the callback service, or an empty element if no username was defined.
Password string The password defined when a registered for the callback service, or an empty element if no password was defined.
RequestId string A unique string that matches the RequestId returned in the synchronous response to the original API request.

A separate callback message is sent for each device that matched the request criteria, indicating whether the operation succeeded for that device. All of the callback messages will have the same RequestId.

Device DeviceIdentifier The device that was changed.
Kind string The type of the device identifier. Valid types of identifiers are:
  • ESN (decimal)
  • ICCID (up to 20 digits)
  • IMEI (up to 15 digits)
  • MDN
  • MEID (hexadecimal)
  • MIN
  • MSISDN
Identifier string The value of the device identifier.
Data CallbackData The data elements for this callback.
CarrierService CarrierServiceCallbackRequest Null for this callback service.
ExternalProvisioningChange ExternalProvisioningChange Null for this callback service.
PromoChange PromoChange Null for this callback service.
Usage DeviceUsage The requested device usage information.
Device DeviceIdentifier One or more identifiers for the device.
Kind string The type of the device identifier. Valid types of identifiers are:
  • ESN (decimal)
  • ICCID (up to 20 digits)
  • IMEI (up to 15 digits)
  • MDN
  • MEID (hexadecimal)
  • MIN
  • MSISDN
Identifier string The value of the device identifier.
DataUsage string The sum of all data, in bytes, that the device sent or received during the specified dates.
SMSUsage string The sum of all SMS usage by the device during the specified dates. This number includes all SMS messages sent by the device and all acknowledged messages sent to the device.
MoSms int The number of SMS messages sent by the device during the reporting period.
MtSms int The number of SMS messages sent to the device during the reporting period.
StartDate dateTime string The first date in the reporting period, in dateTime format.
EndDate dateTime string The last date in the reporting period, in dateTime format.
Fault SoapFault Device-level fault code and information.
SMSDelivery SMSDelivery Null for this callback service.
PRLInformation PRLInformation Null for this callback service.
DeviceSuspendStatus DeviceSuspendStatus Null for this callback service.
Fault SoapFault Information about any errors that may have occurred.
faultcode QName
faultstring string
faultfactor anyURI
detail
Comment string Null for this callback service.
Summary SummaryReport Null for this callback service.
Status string Null for this callback service.
CallbackCount integer The number of times this callback message has been sent.
MaxCallbackThreshold integer The maximum number of times this callback message will be sent if it is not correctly acknowledged.

Example SOAP Request

<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.DeviceService" 
 xmlns:nph1="http://schemas.datacontract.org/2004/07/NPhase.UnifiedWebService.APIs.v2.Contract.Common">
   <soapenv:Header>
     <token xmlns="http://nphase.com/unifiedwebservice/v2">4e0c28cd-dd4a-40b9-adae-bbea774b4aab</token>
   </soapenv:Header>
    <soapenv:Body>
      <v2:GetAggregateDeviceUsage>
         <v2:Input>
            <nph:DeviceList>
               <nph1:DeviceIdentifier>
                  <nph1:Kind>ESN</nph1:Kind>
                  <nph1:Identifier>09102885873</nph1:Identifier>
               </nph1:DeviceIdentifier>
               <nph1:DeviceIdentifier>
                  <nph1:Kind>ESN</nph1:Kind>
                  <nph1:Identifier>09611822299</nph1:Identifier>
               </nph1:DeviceIdentifier>
            </nph:DeviceList>
            <nph:TimestampFilter>
               <nph1:Start>2017-02-01</nph1:Start>
               <nph1:End>2017-02-28</nph1:End>
            </nph:TimestampFilter>
         </v2:Input>
      </v2:GetAggregateDeviceUsage>
   </soapenv:Body>
</soapenv:Envelope>

Example SOAP Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <GetAggregateDeviceUsageResponse xmlns="http://nphase.com/unifiedwebservice/v2">
      <Output xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://schemas.datacontract.org/2004/07/NPhase.UnifiedWebService.APIs.v2.Contract.DeviceService">
        <a:RequestId>6d5ccc6a-d3bc-4a9c-8466-c7f67c15e1f4</a:RequestId>
      </Output>
    </GetAggregateDeviceUsageResponse>
  </s:Body>
</s:Envelope>

Example SOAP Callback Response

Usage Data Callback Message

<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/>
      <Password/>
      <RequestId>5ddb1e8a-8539-40fa-b3c5-b2c63281fbe2</RequestId>
      <Data>
        <Data>
          <CarrierService xsi:nil="true"/>
          <ExternalProvisioningChange xsi:nil="true"/>
          <PromoChange xsi:nil="true"/>
          <Usage>
            <Device>
              <Kind>Mdn</Kind>
              <Identifier>9083074681</Identifier>
            </Device>
            <Device>
              <Kind>Meid</Kind>
              <Identifier>A100001F702731</Identifier>
            </Device>
            <DataUsage>2919181</DataUsage>
            <SMSUsage>70</SMSUsage>
            <MoSms>62</MoSms>
            <MtSms>8</MtSms>
            <StartDate>2017-02-01T00:00:00.0000000</StartDate>
            <EndDate>2017-02-28T00:00:00.0000000</EndDate>
            <Fault xsi:nil="true"/>
          </Usage>
          <SMSDelivery xsi:nil="true"/>
          <PRLInformation xsi:nil="true"/>
          <GoToState xsi:nil="true"/>
          <Fault xsi:nil="true"/>
          <Comment xsi:nil="true"/>
          <Summary xsi:nil="true"/>
          <Status xsi:nil="true" />
          <CallbackCount>1</CallbackCount>
          <MaxCallbackThreshold>4</MaxCallbackThreshold/>
        </Data>
      </Data>
    </CallbackRequest>
  </s:Body>
</s:Envelope>

Request Completed Callback Message

<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/>
      <Password/>
      <RequestId>5ddb1e8a-8539-40fa-b3c5-b2c63281fbe2</RequestId>
      <Data>
        <Data>
          <CarrierService xsi:nil="true"/>
          <ExternalProvisioningChange xsi:nil="true"/>
          <PromoChange xsi:nil="true"/>
          <SMSDelivery xsi:nil="true"/>
          <PRLInformation xsi:nil="true"/>
          <GoToState xsi:nil="true"/>
          <Fault xsi:nil="true"/>
          <Comment>Request Completed Processing</Comment>
          <Summary xsi:nil="true"/>
          <Status xsi:nil="true" />
          <CallbackCount>1</CallbackCount>
          <MaxCallbackThreshold>4</MaxCallbackThreshold/>
        </Data>
      </Data>
    </CallbackRequest>
  </s:Body>
</s:Envelope>

Request Schema Diagram

Response Schema Diagram