org.gsm.oneapi.sms
Class SMSSend

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

public class SMSSend
extends java.lang.Object


Field Summary
static boolean dumpRequestAndResponse
           
 
Constructor Summary
SMSSend(ServiceEndpoints endPoints, java.lang.String authorisationHeader)
          Creates a new instance of the Send SMS API main interface.
 
Method Summary
 int cancelDeliveryNotifications(java.lang.String subscriptionId)
          Stop subscribing to delivery status notifications for all your sent SMS
static void main(java.lang.String[] args)
           
 SMSSendDeliveryStatusResponse queryDeliveryStatus(java.lang.String senderAddress, java.lang.String requestId)
          Query the delivery status for an SMS sent to one or more mobile terminals
 SMSSendResponse sendSMS(java.lang.String senderAddress, java.lang.String[] address, java.lang.String message, java.lang.String clientCorrelator, java.lang.String notifyURL, java.lang.String senderName, java.lang.String callbackData)
          Send an SMS to one or more mobile terminals
 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
 SMSDeliveryReceiptSubscriptionResponse subscribeToDeliveryNotifications(java.lang.String senderAddress, java.lang.String clientCorrelator, java.lang.String notifyURL, java.lang.String callbackData)
          Start subscribing to delivery status notifications for all your sent SMS
 
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

SMSSend

public SMSSend(ServiceEndpoints endPoints,
               java.lang.String authorisationHeader)
Creates a new instance of the Send SMS API main interface. Requires endPoints to define the URL targets of the various Send 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)

sendSMS

public SMSSendResponse sendSMS(java.lang.String senderAddress,
                               java.lang.String[] address,
                               java.lang.String message,
                               java.lang.String clientCorrelator,
                               java.lang.String notifyURL,
                               java.lang.String senderName,
                               java.lang.String callbackData)
Send an SMS to one or more mobile terminals

Parameters:
senderAddress - (mandatory) is the address to whom a responding SMS may be sent. Do not URL encode this value prior to passing to this function
address - (mandatory) contains at least one address for each end user ID to send to; in this case their MSISDN including the Ôtel:Õ protocol identifier and the country code preceded by Ô+Õ. i.e., tel:+16309700001. OneAPI also supports the Anonymous Customer Reference (ACR) if provided by the operator.
message - (mandatory) contains the message text to send.Messages over 160 characters may end up being sent as two or more messages by the operator.
clientCorrelator - (optional) uniquely identifies this create MMS request. If there is a communication failure during the request, using the same clientCorrelator when retrying the request allows the operator to avoid sending the same MMS twice.
senderName - (optional) is the name to appear on the userÕs terminal as the sender of the message
notifyURL - (optional) is the URL to which you would like a notification of delivery sent
callbackData - (optional) will be passed back to the notifyURL location, so you can use it to identify the message the receipt relates to (or any other useful data, such as a function name)
See Also:
SMSSendResponse

queryDeliveryStatus

public SMSSendDeliveryStatusResponse queryDeliveryStatus(java.lang.String senderAddress,
                                                         java.lang.String requestId)
Query the delivery status for an SMS sent to one or more mobile terminals

Parameters:
senderAddress - (mandatory) is the address from which SMS messages are being sent. Do not URL encode this value prior to passing to this function
requestId - (mandatory) contains the requestId returned from a previous call to the sendSMS function
See Also:
SMSSendDeliveryStatusResponse

subscribeToDeliveryNotifications

public SMSDeliveryReceiptSubscriptionResponse subscribeToDeliveryNotifications(java.lang.String senderAddress,
                                                                               java.lang.String clientCorrelator,
                                                                               java.lang.String notifyURL,
                                                                               java.lang.String callbackData)
Start subscribing to delivery status notifications for all your sent SMS

Parameters:
senderAddress - (mandatory) is the address from which SMS messages are being sent. Do not URL encode this value prior to passing to this function
notifyURL - (mandatory) is the URL to which you would like a notification of delivery sent
clientCorrelator - (optional) uniquely identifies this subscription request. If there is a communication failure during the request, using the same clientCorrelator when retrying the request allows the operator to avoid setting up the same subscription twice
callbackData - (optional) will be passed back to the notifyURL location, so you can use it to identify the message the delivery receipt relates to (or any other useful data, such as a function name)
See Also:
SMSDeliveryReceiptSubscriptionResponse

cancelDeliveryNotifications

public int cancelDeliveryNotifications(java.lang.String subscriptionId)
Stop subscribing to delivery status notifications for all your sent SMS

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

main

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