Retrieves queued SMS messages sent by all M2M devices associated with an account.
Mobile-originated SMS messages are stored in a queue in the ThingSpace Platform if they cannot be delivered to your application immediately via the EnhancedConnectivityService callback. When your application sends a GetSmsMessages request, the M2M Platform sends queued messages as a list. To ensure that messages are not lost, they remain in the queue until your application explicitly acknowledges that it received them by sending another request that contains the Token value from the response.
Here is the general flow for mobile-originated SMS messages:
When your EnhancedConnectivityService callback listener is working, new SMS messages received from devices will be sent as soon as they are received by the ThingSpace Platform. Any queued messages are not sent automatically; you must use StartSmsCallback or GetSmsMessages to retrieve those messages from the queue.
The SMS messages may be received out of order, relative to the order in which they were sent.
Each call to GetSmsMessages returns up to 100 SMS messages. If there are more than 100 SMS messages waiting in the queue for the specified account, you must call GetSmsMessages repeatedly to retrieve all of those messages, using the PreviousToken parameter to acknowledge receipt of the previous block of messages and request the next block. If there are errors in transmitting or acknowledging messages, the affected messages remain in the queue until they are successfully transmitted and acknowledged.
Parameter | Type | Description |
---|---|---|
AccountName
required |
string | An account name. SMS messages that were sent from devices associated with this account will be retrieved. |
PreviousToken
optional |
string |
The Token returned by the previous call to this API, if any.
|
Parameter | Type | Description |
---|---|---|
RetrievedSmsMessages | RetrievedSmsMessage | A list of up to 100 SMS messages that were sent by devices in the account. |
Device | DeviceIdentifierCollection | Identifiers for the device that sent the message. |
DeviceIdentifiers | DeviceIdentifier | One or more identifiers for the device. |
Kind | string | The type of the device identifier. Valid types of identifiers are:
|
Identifier | string | The value of the device identifier. |
Message | string | The contents of the SMS message. |
Timestamp | dateTime | The date and time that the message was received by the Verizon ThingSpace Platform. |
Token | string | A token that uniquely identifies the set of messages that were returned. To ensure reliability, they will not be removed from the queue until you call this API again and pass this value in the PreviousToken field. |
<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.EnhancedConnectivityService"> <soapenv:Header> <v2:token>a56832d9-b870-4e5d-85b8-57003a592a01</v2:token> </soapenv:Header> <soapenv:Body> <v2:GetSmsMessages> <v2:Input> <nph:AccountName>account_name</nph:AccountName> <nph:PreviousToken></nph:PreviousToken> </v2:Input> </v2:GetSmsMessages> </soapenv:Body> </soapenv:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <GetSmsMessagesResponse 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.EnhancedConnectivityService"> <a:RetrievedSmsMessages> <a:RetrievedSmsMessage> <a:Device xmlns:b="http://schemas.datacontract.org/2004/07/NPhase.UnifiedWebService.APIs.v2.Contract.Common"> <b:DeviceIdentifiers> <b:DeviceIdentifier> <b:Kind>esn</b:Kind> <b:Identifier>09613489171</b:Identifier> </b:DeviceIdentifier> <b:DeviceIdentifier> <b:Kind>mdn</b:Kind> <b:Identifier>8587757416</b:Identifier> </b:DeviceIdentifier> </b:DeviceIdentifiers> </a:Device> <a:Message>testmessage1</a:Message> <a:TimeStamp>2013-07-15T12:29:49.5815306-05:00</a:TimeStamp> </a:RetrievedSmsMessage> <a:RetrievedSmsMessage> <a:Device xmlns:b="http://schemas.datacontract.org/2004/07/NPhase.UnifiedWebService.APIs.v2.Contract.Common"> <b:DeviceIdentifiers> <b:DeviceIdentifier> <b:Kind>esn</b:Kind> <b:Identifier>09613489171</b:Identifier> </b:DeviceIdentifier> <b:DeviceIdentifier> <b:Kind>mdn</b:Kind> <b:Identifier>8587757416</b:Identifier> </b:DeviceIdentifier> </b:DeviceIdentifiers> </a:Device> <a:Message>testmessage2</a:Message> <a:TimeStamp>2013-07-15T13:29:49.5815306-05:00</a:TimeStamp> </a:RetrievedSmsMessage> </a:RetrievedSmsMessages> <a:Token>363b9b80-440e-4431-98b8-357b6208b331</a:Token> </Output> </GetSmsMessagesResponse> </s:Body> </s:Envelope>