GetSMSEventHistory

Returns the history of mobile-originated/mobile-terminated SMS messages for a single device that were sent or received via ThingSpace, within a specified time period.

Uses and Requirements

Each response includes a maximum of 500 records. To obtain more records, you can call the API multiple times, adjusting the TimestampFilter each time to start where the previous request finished.

Request Parameters

Parameter Type Description
Device
required
DeviceIdentifier

The device for which you want SMS event history, specified by device identifier.

NOTE: You can use GetDeviceList to get a list of all devices in the account.

Kind
required
string The type of the device identifier. Valid types of identifiers are:
  • ESN (decimal)
  • ICCID (up to 20 digits)
  • IMEI (up to 16 digits)
  • MDN
  • MEID (hexadecimal)
  • MSISDN
Identifier
required
string The value of the device identifier.
Earliest
required
dateTime Only include smsEvents that occurred after this date and time range.
Latest
required
dateTime Only include smsEvents that occurred before this date and time range.

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 ThingSpace Platform sends a separate callback message for each device that matched the request criteria, indicating whether the operation succeeded for that device and containing any requested information. All of the callback messages have the same RequestId.

Callback Response Parameters

Parameter Type Description
Device DeviceIdentifier The device for which the usage history was returned.
Kind string The type of the device identifier. Valid types of identifiers are:
  • ESN (decimal)
  • ICCID (up to 20 digits)
  • IMEI (up to 16 digits)
  • MDN
  • MEID (hexadecimal)
  • MIN
  • MSISDN
Identifier string The value of the device identifier.
SmsEvents Array of SmsEvent objects List of Sms events, sorted by timestamp, oldest first.
Timestamp dateTime The date and time at which the event occurred.
SmsType string Valid values include: MoSms - mobile originated and MtSms - mobile terminated.
SentTo string The device identifier to which the message was sent.
SentFrom string The device identifier from where the message was sent.
Message string The content of the Sms message.
ExtendedAttributes ExtendedAttributesObj Null for this callback.

Example SOAP Request

    <v2:GetSmsEventHistory>
             
             <v2:Input>
                <nph:Device>
                   <nph1:Kind>mdn</nph1:Kind>
                   <nph1:Identifier>6144006978</nph1:Identifier>
                </nph:Device>
                <nph:TimestampFilter>
                   <nph1:Earliest>2019-08-11T22:16:04.233</nph1:Earliest>
                   <nph1:Latest>2019-09-11T22:16:04.233</nph1:Latest>
                </nph:TimestampFilter>
             </v2:Input>
          </v2:GetSmsEventHistory>
    

Example SOAP Callback Response

    <GetSmsEventHistoryResponse xmlns="http://nphase.com/unifiedwebservice/v2">
       <Output xmlns:a="http://schemas.datacontract.org/2004/07/NPhase.UnifiedWebService.APIs.v2.Contract.DeviceService"       xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
           <a:Device xmlns:b="http://schemas.datacontract.org/2004/07/NPhase.UnifiedWebService.APIs.v2.Contract.Common">
             <b:Kind>iccid</b:Kind>
             <b:Identifier>89148000001140386734</b:Identifier>
          </a:Device>
          <a:SmsEvents xmlns:b="http://schemas.datacontract.org/2004/07/NPhase.UnifiedWebService.APIs.v2.Contract.Common">
             <b:SmsEvent>
                <b:TimeStamp>2019-09-01T21:57:47Z</b:TimeStamp>
                <b:SmsType>MtSms</b:SmsType>
                <b:SentTo>6144006992</b:SentTo>
                <b:SentFrom i:nil="true"/>
                <b:Message>24:EN:1570=BB=03=Bypass Zone>0844 test device active</b:Message>
                <b:Encoding>US-ASCII</b:Encoding>
                <b:DeliveryStatus>Scheduled<DeliveryStatus>
             </b:SmsEvent>
             <b:SmsEvent>
                <b:TimeStamp>2019-09-01T23:41:59Z</b:TimeStamp>
                <b:SmsType>MtSms</b:SmsType>
                <b:SentTo>6144006992</b:SentTo>
                <b:SentFrom i:nil="true"/>
                <b:Message>24:EN:1570=BB=03=Bypass Zone>0844 test device active</b:Message>
                <b:Encoding>US-ASCII</b:Encoding>
                <b:DeliveryStatus>Scheduled<DeliveryStatus>
             </b:SmsEvent>
       </Output>
    </GetSmsEventHistoryResponse>