WebSphere brand IBM WebSphere Telecom Web Services Server, Version 7.1

SMS interface

Several operations are available for the SMS interface using the REST API. All of these operations are based on the Parlay X 2.1 standard.

Note: In the following examples, replace path with the following URL:
  • For REST: http://hostName:port/ShortMessageService/services/REST
  • For JSON: http://hostName:port/ShortMessageService/services/JSON

sendSms via POST

Provides a subset of that standard's functionality. This interface is for sending an SMS to a terminal, for example from a Web page or desktop application. This lets you send an SMS to one or more terminals, for example mobile phones or SMS-enabled laptop computers.

Sample REST request
POST path/sms?version=1.0&address=tel:+447990123456&
address=tel:+447990121212&
message=Hello%20World&
correlator=123456&
notifyURL=http://myapp.developer.com/deliveryreceipt&
senderName=Bob HTTP/1.1
Host: www.example.com
Note: If you supply a value for notifyURL, a default value of SendSms is supplied as the interfaceName. (interfaceName is a mandatory parameter from the Parlay X 2.1 perspective.)
Sample REST response
HTTP Status: 201 Created
<SMSResponse version= “1.0” messageid=“ID123ABC”/>
Sample JSON request
POST http://localhost:9080/ShortMessageService/services/JSON/sms
{"addresses": 
["tel:9845054321", "tel:9632112333"],
"senderName": "JDoe",
"charging": {
"description": "someDesc",
currency": "INR",
"amount": "0.50",
"code": "SMS- national"
      },
"message":"hello"
}


Sample JSON response
HTTP/1.1 200 OK
{
"result":"ID123ABC"
}

getSmsDeliveryStatus via GET

When you send an SMS message, it is sent through an SMS router (SMSC) in the operator network. This queues and sends your message to the recipient or recipients. This method lets you know if that message has been delivered.

Sample REST request
GET path/sms?version=1.0&messageId=1234 HTTP/1.1
Host: www.example.com
Sample REST response
<DeliveryStatusResponse version="1.0">
<Message address=tel:+447990123456 status="DeliveredToNetwork" />
<Message address=tel:+447990121212 status="MessageWaiting" />
</DeliveryStatusResponse>
Sample JSON request
POST http://localhost:9080/ShortMessageService/services/JSON/smsDeliveryStatus
{
"requestIdentifier":"1234"
}
Sample JSON response
{"result": [
{
"address": "tel:1234",
"deliveryStatus":"DeliveryImpossible"
},
{
"address":"tel:123445
"deliveryStatus":"DeliveredToNetwork"
},
{
"address":"tel:098787878",
"deliveryStatus":"DeliveryUncertain"
}
]}

notifySmsDeliveryReceipt via POST

Used for notifying the application when an SMS is delivered to a terminal or if delivery was impossible.

Sample REST request
POST path/smsDeliveryReceipt?correlator=123456 HTTP/1.1
Host: myapp.developer.com
----------HTTP – Body-------------
<deliveryStatus version=”1.0">
<Message address=tel:+447990123456 status=”DeliveredToTerminal”/>
<address=tel:+447990121212 status=”DeliveryImpossible” >
</deliveryStatus
Sample REST response
HTTP Status: 204 No Content.
Sample JSON request
POST http://localhost:9080/SmsNotificationService/services/JSON/smsDeliveryReceipt
{
"correlator": "ABC123",
"deliveryStatus": {
"address": "http://www.your.org",
"deliveryStatus":"DeliveryImpossible"
   }
}
Sample JSON response
HTTP Status: 200 OK
{}

getReceivedSms via GET

Enables the application to "poll" for any SMS messages received.

Sample REST request
GET path/receivedSms?version=1.0&registrationId=6789 HTTP/1.1
Host: www.example.com
Sample REST response
HTTP Status: 200 OK 
<ReceivedSmsResponse version=”1.0”>
   <Message content=”Vote A” sender=”tel:+447790123456” destination=”81771” datetime= Tue, 15 Nov 1994 08:12:31 GMT”/>
   <Message content=”Vote B” sender=”tel:+447790121212” destination=”81771” datetime=”Tue, 15 Nov 1994 08:12:31 GMT”/>
</ReceivedSmsResponse>
Sample JSON request
POST http://localhost:9080/ShortMessageService/services/JSON/receivedSms
{"registrationIdentifier":"1234"}
Sample JSON response
{"result":[
        {
"message": "Vote A",
"senderAddress": "tel:123",
smsServiceActivationNumber": "tel:5555"
},
    {
"message": "Vote B",
"senderAddress": "tel:12345",
"smsServiceActivationNumber": "tel:5555"
    }
]}

startSmsNotification via POST

Used to start the notification of received SMS.

Sample REST request
POST path/smsNotification?destination=81771&criteria=Vote&
notifyURL= http://myapp.example.com/voting/&
correlator=123456 HTTP/1.1
Host: www.example.com
Note: If you supply a value for notifyURL, a default value of SmsNotificationManager is supplied as the interfaceName. (interfaceName is a mandatory parameter from the Parlay X 2.1 perspective.)
Sample REST response
HTTP Status: 204 No Content.
Sample JSON request
POST http://localhost:9080/ShortMessageService/services/JSON/startSmsNotification
{
   "reference": {
   "endpoint": "http://localhost:9082/TestClientEvents/services/SmsNotification",
   "interfacename": "SMSNotificationManager",
   "correlator": "Cricket 1" 
    },
    "smsserviceactivationnumber": "tel:5555",
    "criteria": "VOTE B"
}
Sample JSON response
HTTP/1.1 200 OK
{}

stopSmsNotification via DELETE

Used by the application to stop the delivery receipt notifications.

Sample REST request
DELETE path/smsNotification?correlator=123456 HTTP/1.1
Host: www.example.com
Sample REST response
HTTP Status: 204 No Content.
Sample JSON request
POST http://localhost:9080/ShortMessageService/services/JSON/stopSmsNotification
{
"correlator":"123-123"
}
Sample JSON response
HTTP/1.1 200 OK
{}

notifySmsReception via POST

Notifies the application when an SMS is received.

Sample REST request
POST path/smsReception?correlator=123456 HTTP/1.1
Host: myapp.developer.com
Content-Type: text/xml	
----------HTTP – Body-------------
<ReceivedSms version=”1.0”>
<Message content="Vote A" sender=tel:+447790123456" destination="81771"
datetime=”Tue, 15 Nov
1994 08:12:31 GMT"/>
<Message content="Vote B" sender="tel:+447790121212" destination="81771"
datetime="Tue, 15 Nov
1994 08:12:31 GMT"/>
</ReceivedSms>
Sample REST response
HTTP Status: 204 No Content
Sample JSON request
POST http://localhost:9080/SmsNotificationService/services/JSON/smsReception
{
correlator":"Cricket",
"message":{
"message":"voteA",
"senderAddress":"tel:+9880663630",
"smsServiceActivationNumber":"5500",
dateTime":"2003-08-09T00:18:37"
}
Sample JSON response
HTTP Status: 200 OK
{}



Terms of use
(C) Copyright IBM Corporation 2009. All Rights Reserved.