public class SmsClient extends java.lang.Object
NexmoClient.getSmsClient().| Constructor and Description |
|---|
SmsClient(HttpWrapper httpWrapper)
Create a new SmsClient.
|
| Modifier and Type | Method and Description |
|---|---|
SearchSmsResponse |
searchMessages(java.util.Date date,
java.lang.String to)
Search for completed SMS transactions by date and recipient MSISDN.
|
SearchSmsResponse |
searchMessages(SearchSmsRequest request)
Search for completed SMS transactions.
|
SearchSmsResponse |
searchMessages(java.lang.String id,
java.lang.String... ids)
Search for completed SMS transactions by ID
|
SearchRejectedMessagesResponse |
searchRejectedMessages(java.util.Date date,
java.lang.String to)
Search for rejected SMS transactions by date and recipient MSISDN.
|
SearchRejectedMessagesResponse |
searchRejectedMessages(SearchRejectedMessagesRequest request)
Search for rejected SMS transactions using a
SearchRejectedMessagesRequest. |
SmsSubmissionResult[] |
submitMessage(Message message)
Send an SMS message.
|
public SmsClient(HttpWrapper httpWrapper)
public SmsSubmissionResult[] submitMessage(Message message) throws java.io.IOException, NexmoClientException
This uses the supplied object to construct a request and post it to the Nexmo API.
This method will respond with an array of SmsSubmissionResult objects. Depending on the nature and length of the submitted message, Nexmo may automatically
split the message into multiple sms messages in order to deliver to the handset. For example, a long text sms of greater than 160 chars will need to be split
into multiple 'concatenated' sms messages. The Nexmo service will handle this automatically for you.
The array of SmsSubmissionResult objects will contain a SmsSubmissionResult object for every actual sms that was required to submit the message.
each message can potentially have a different status result, and each message will have a different message id.
Delivery notifications will be generated for each sms message within this set and will be posted to your application containing the appropriate message id.
message - The message request object that describes the type of message and the contents to be submitted.NexmoResponseParseException - if the HTTP response could not be parsed.java.io.IOException - There has been an error attempting to communicate with the Nexmo service (e.g. Network failure).NexmoClientExceptionpublic SearchSmsResponse searchMessages(SearchSmsRequest request) throws java.io.IOException, NexmoClientException
You should probably use the helper methods searchMessages(String, String...) or
searchMessages(String, String...) instead.
java.io.IOExceptionNexmoClientExceptionpublic SearchSmsResponse searchMessages(java.lang.String id, java.lang.String... ids) throws java.io.IOException, NexmoClientException
id - the first ID to look upids - optional extra IDs to look upjava.io.IOExceptionNexmoClientExceptionpublic SearchSmsResponse searchMessages(java.util.Date date, java.lang.String to) throws java.io.IOException, NexmoClientException
date - the date of the SMS message to be looked upto - the MSISDN number of the SMS recipientjava.io.IOExceptionNexmoClientExceptionpublic SearchRejectedMessagesResponse searchRejectedMessages(SearchRejectedMessagesRequest request) throws java.io.IOException, NexmoClientException
SearchRejectedMessagesRequest.
You should probably use searchRejectedMessages(Date, String) instead.
java.io.IOExceptionNexmoClientExceptionpublic SearchRejectedMessagesResponse searchRejectedMessages(java.util.Date date, java.lang.String to) throws java.io.IOException, NexmoClientException
date - the date of the rejected SMS message to be looked upto - the MSISDN number of the SMS recipientjava.io.IOExceptionNexmoClientException