org.gsm.oneapi.sms
Class SMSRetrieve

java.lang.Object
  extended by org.gsm.oneapi.sms.SMSRetrieve

public class SMSRetrieve
extends java.lang.Object


Field Summary
static boolean dumpRequestAndResponse
           
 
Constructor Summary
SMSRetrieve(ServiceEndpoints endPoints, java.lang.String authorisationHeader)
          Creates a new instance of the Receive SMS API main interface.
 
Method Summary
 int cancelReceiptNotifications(java.lang.String subscriptionId)
          Stop subscribing to message receipt notifications for all your received SMS
static void main(java.lang.String[] args)
           
 RetrieveSMSResponse retrieveMessages(java.lang.String registrationId, int maxBatchSize)
          Retrieve SMS messages sent to your Web application
 void setAuthorisationHeader(java.lang.String authorisationHeader)
          Can be used to update the service authorisation header
 void setEndpoints(ServiceEndpoints endPoints)
          Can be used to update the service endpoints
 SMSMessageReceiptSubscriptionResponse subscribeToReceiptNotifications(java.lang.String destinationAddress, java.lang.String notifyURL, java.lang.String criteria, java.lang.String notificationFormat, java.lang.String clientCorrelator, java.lang.String callbackData)
          Start subscribing to notifications of SMS messages sent to your application
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dumpRequestAndResponse

public static boolean dumpRequestAndResponse
Constructor Detail

SMSRetrieve

public SMSRetrieve(ServiceEndpoints endPoints,
                   java.lang.String authorisationHeader)
Creates a new instance of the Receive SMS API main interface. Requires endPoints to define the URL targets of the various Receive SMS network calls and authorisationHeader containing the username/password used for HTTP Basic authorisation with the OneAPI server.

Parameters:
endPoints - contains a set of service/ call specific endpoints
authorisationHeader - Base 64 encoded username/ password
See Also:
ServiceEndpoints, JSONRequest.getAuthorisationHeader(String, String)
Method Detail

setEndpoints

public void setEndpoints(ServiceEndpoints endPoints)
Can be used to update the service endpoints

Parameters:
endPoints - contains a set of service/ call specific endpoints
See Also:
ServiceEndpoints

setAuthorisationHeader

public void setAuthorisationHeader(java.lang.String authorisationHeader)
Can be used to update the service authorisation header

Parameters:
authorisationHeader - Base 64 encoded username/ password
See Also:
JSONRequest.getAuthorisationHeader(String, String)

retrieveMessages

public RetrieveSMSResponse retrieveMessages(java.lang.String registrationId,
                                            int maxBatchSize)
Retrieve SMS messages sent to your Web application

Parameters:
registrationId - (mandatory) is agreed with your network operator for receiving messages
maxBatchSize - (mandatory) is the maximum number of messages to retrieve in this request
See Also:
RetrieveSMSResponse

subscribeToReceiptNotifications

public SMSMessageReceiptSubscriptionResponse subscribeToReceiptNotifications(java.lang.String destinationAddress,
                                                                             java.lang.String notifyURL,
                                                                             java.lang.String criteria,
                                                                             java.lang.String notificationFormat,
                                                                             java.lang.String clientCorrelator,
                                                                             java.lang.String callbackData)
Start subscribing to notifications of SMS messages sent to your application

Parameters:
destinationAddress - (mandatory) is the address/ MSISDN, or code agreed with the operator, to which people may send an SMS to your application
notifyURL - (mandatory) is the URL to which you would like a notification of message receipts sent
criteria - (optional) is case-insensitve text to match against the first word of the message, ignoring any leading whitespace. This allows you to reuse a short code among various applications, each of which can register their own subscription with different criteria
notificationFormat - (optional) is the content type that notifications will be sent in Ð for OneAPI v1.0 only JSON is supported
clientCorrelator - (optional) uniquely identifies this create subscription request. If there is a communication failure during the request, using the same clientCorrelator when retrying the request allows the operator to avoid creating a duplicate subscription
callbackData - (optional) is a function name or other data that you would like included when the POST is sent to your application
See Also:
SMSMessageReceiptSubscriptionResponse

cancelReceiptNotifications

public int cancelReceiptNotifications(java.lang.String subscriptionId)
Stop subscribing to message receipt notifications for all your received SMS

Parameters:
subscriptionId - (mandatory) contains the subscriptionId of a previously created SMS message receipt subscription

main

public static void main(java.lang.String[] args)