Products that are referred to in this document may be either trademarks and/or registered trademarks of the
respective owners.
While every precaution has been taken in the preparation of this document, the publisher and the author assume no
responsibility for errors or omissions, or for damages resulting from the use of information contained in this
document or from the use of programs and source code that may accompany it. In no event shall the publisher and
the author be liable for any loss of profit or any other commercial damage caused or alleged to have been caused
directly or indirectly by this document.
Table of Contents
SOPRANO MEMS HTTP Interface Developers Guide 5
Interface Description 6
Getting Started with the HTTP Interface 7
Send SMS Messages 8
Request 8
Response 9
Commands 9
Send SMS Messages to Groups and Lists 22
Request 23
Response 23
Commands 23
Receive SMS Messages 29
Preferences 29
Request 30
Response 30
Commands 30
Receive SMS Delivery Reports Messages 32
Delivery Receipt Format 32
WAP Push 34
Request 34
Response 34
Commands 35
Query SMS Messages 38
Request 38
Response 38
Commands 39
Cancel SMS Messages 42
Request 42
Response 42
Commands 43
Appendices 45
Appendix A - API Capabilities 45
Appendix B - Abbreviations 49
Appendix C - Response Details HTTP 49
Appendix D - DCS Parameter Details 53
Appendix E - Text & Data Parameter Restrictions 55
Appendix F - XML response DTD 56
Appendix G - Example Code 57
Appendix H - FAQ 59
This document provides a technical overview of the HTTP for the SOPRANO Mobile Enterprise Messaging Suite
platform. For MMS information, please refer to or request a copy of separate HTTP MMS Interface Developers
Guide.
Intended Audience
This document is intended for SOPRANO MEMS customers interested in using SOPRANO MEMS’s HTTP interfaces
for sending SMS. A basic knowledge of the HTTP protocol is required as a minimum.
Interface Description
HTTP interface can be used to send or receive messages by sending HTTP POST requests or through URL (HTTP
GET). Only the GET method is used to deliver received messages.
It is recommended to use the 'POST' method when sending messages due to the URL length limitations and
restriction to the ASCII character-set if 'GET' method. However, examples throughout this document mainly use the
GET method for ease of understanding and demonstration.
A record of all messages sent via the HTTP POST interface is recorded in SOPRANO Mobile Enterprise Messaging
Suite and can be accessed via the web or other reporting interfaces.
All requests are submitted through the HTTP POST or GET method using
UTF-8 encoding and URL encoded values.
The expected "Content-Type" for POST requests is "application/x-www-
form-urlencoded", however "multipart/form-data" if the message is MMS is
also supported.
All 'send' commands require authentication which is implemented via HTTP Basic Authentication – refer to
'References [6]') for any requests made. Since basic authentication is inherently insecure (e.g. username and
passwords sent as clear-text over the internet and therefore open to interception by a third party), an SSL secured
interface can be used.
Note: The default for all recipient and source numbers is valid international format (i.e. country code
followed by the number) without spaces and special characters such as '+'. For example: 61491234567.
Additional Information
HTTP URL depends upon the service that you will utilise.The following is a list of SOPRANO MEMS HTTP Interface
URLs :
Command URL
sendmsg https://apac.soprano.com.au/cgphttp/servlet/sendmsg
startbatch https://apac.soprano.com.au/cgphttp/servlet/startbatch
sendbatch https://apac.soprano.com.au/cgphttp/servlet/sendbatch
sendwappush https://apac.soprano.com.au/cgphttp/servlet/sendwappush
querymsg https://apac.soprano.com.au/cgphttp/servlet/querymsg
cancelmsg https://apac.soprano.com.au/cgphttp/servlet/cancelmsg
Prerequisite
You must have requested the HTTP API to be provisioned when filling in the order form. If you wish to receive
messages in response to the messages you send through your API, then you need to explicitly request this on your
order form.
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?destination=$mydestination&text=$text
Note:
$mydestination is the mobile number you want to send to in international format i.e. 61491234567
$text is the text that you wish to send.
Step 2.b: You will be prompted by your browser for your username and password. This should match the
username you provided at the time of provisioning.
Step 2.c: You should receive a confirmation in your browser window that the message was successfully sent,
and the message's Client Message ID, which can be used to interrogate the message status.
Note: For receiving forwarded messages or responses from the source IP address, you need to white list the web-
server IP address. Below are the web-server IP addresses that may be added to the anti-spam filter white-list:
116.51.13.84, 116.51.13.85
58.65.27.52, 58.65.27.53
Please note that all mobile numbers must be entered in international format when using the
APIs & interfaces.
Request
The request for message submission using the POST method conforms to the following structure:
destination=61491234568&text=initial+test+message
The above example displays a basic SMS request, where the customer’s username and password are provided
within the authorization header field.
The example is only valid when there is a pooled SMS source address defined to be used as a source address.
Users have the option to use a specific source address from the address list available for the user by adding 'source'
parameter to the request.
An example of message submission 'Request' using the GET method may look like:
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?
destination=61491234568&text=initial+test+message
Authentication
Access to the SOPRANO MEMS host requires authentication which is implemented via HTTP Basic Authentication.
You need to include the Base64 encoded value of username and password in 'Authorization' header of HTTP.
Format of the Authorization header:
The username and password are expected to be presented in the format username:password and encoded into
Base64. For example, the below header will present a username and password of user@url.com:Password1.
Alternatively, if you do not wish to use the basic authentication method for your submission you may use the HTTP
parameters 'username' and 'password' to authenticate your request.
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?
username=demo@url.com.au&password=mypwd01&destination=61491234568&text=initia
l+test+message
Note: If you provide both username and password in the URL parameters AND in your basic authentication, the
URL parameters will be ignored and the basic authentication values will be used.
'sendmsg Commands section' describes the commands that can be used to submit messages to SOPRANO MEMS
and corresponding responses for the HTTP interface, and their corresponding parameters.
Response
The following is an example response for the example POST request above:
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=B76916114E6610F0E636EE355FE2B8B7; Path=/cgphttp
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Content-Length: 30
Date: Wed, 13 Aug 2008 03:52:48 GMT
Status Line=HTTP/1.1 200 OK
0 001 OK
Message-ID: 7836
The body of all successfully received responses to message submission requests by SOPRANO MEMS will contain
a one digit success code (0 = success or 1 = error), a three digit response code , a response string and an
identifier for the message (which can be used when querying/canceling the message).
If the request could not be interpreted by SOPRANO MEMS (e.g. due to an unrecognised format, or missing
mandatory parameters), the response will contain a success code of 2 (indicating an error with the command), a
response code (refer to Table 2) and a response string (refer to Table 2) identifying the error. Example response:
HTTP/1.1 200 OK
Server: Apache/1.3
Date: Mon, 21 Jun 2004 09:15:23 GMT
Content-Type: text/plain
Content-Length: 9
Note that the response contains text intended for use in automated applications.
Section Appendix C: Response Details describes the commands and corresponding responses for the HTTP
interface, and their corresponding parameters.
Commands
'Send SMS Message' commands include:
sendmsg
startbatch
sendbatch
sendmsg
The sendmsg command is used to send an SMS message to one or more recipients.
Specifies the destination the reply goes to. This can be If not provided:
a valid MSISDN, email, URL, or a valid inbound order ID
etc. Default: Empty/null
http://apac.soprano.com.au/cgphttp/servlet/sendmsg?
destination=61491234568&text=initial+test+message&source=61498765432
For the above example, the mentioned source address has to be a valid address. The purpose is to force messages
to be sent from a specific source address rather using a pooled source address.
Alternatively, if you do not specify a source address, the system will automatically allocate one from a configurable
pool of source addresses.
http://apac.soprano.com.au/cgphttp/servlet/sendmsg?
destination=61491234568&text=initial+test+message
Using the above example sends the message using one of the pooled source addresses.
Response:
0 001 OK
Message-ID: 12300012
Response:
<response>
<message>
<success_code>0</success_code>
<response_code>001</response_code>
<response_string>OK</response_string>
<message_id>1167</message_id>
</message>
</response>
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?
destination=61491234568&text=initial+test+message&source=61498765432
Response:
Request:
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?
destination=61491234568,61498765432,61491234567&text=initial+test
+message&source=61403020000
Response:
0 001 OK
Message-ID: 12300014
Request (TEXT):
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?
destination=61491234568,61498765432,000024,095123&text=initial+test
+message&source=61403020000
Response (TEXT):
1 040 ERROR
Message-ID: 12300011
61491234568 001
61498765432 001
000024 101
095123 101
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?
destination=61491234568,61498765432,000024,095123&text=initial+test
+message&source=61491234567&responseType=1
Response (XML):
<response>
<message>
<success_code>1</success_code>
<response_code>040</response_code>
<response_string>ERROR
61491234568 001
61498765432 001
000024 101
095123 101
</response_string>
<message_id>1167</message_id>
</message>
</response>
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?
destination=61491234568,61498765432&text=initial+test
+message&source=61491234567®istered=1
Response:
0 001 OK
Message-ID: 1001
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?
destination=61498765432&text=hello13&dcs=8&replyToTON=8&replyTo=demo@url.com
.au&replytoton=8®istered=1
Turn handset off. Once the message has expired, the SMSC platform will forward the delivery receipt to the reply
address, in this case an email address (into email client).
source=61491234568
destination=61498765432
clientMessageId=
text=id:4988312 sub:001 dlvrd:001 submit date:1005251604 done date:1005251609 stat:EXPIRED err:000 text:No
Text
startbatch
The 'startbatch' command is used to initiate batch messaging. It defines the common elements for a batch of
messages, including a message template containing customised fields (customised fields should be referred to within
the message template as field1 through to fieldN). The ID returned in response to a startbatch request must be used
in sendbatch requests to link data with a message template.
The identifier returned from this command must be used when sending subsequent messages via the sendbatch
command.
The batch ID is valid for a period of 24 hours after it was generated, and is not persistent in the unlikely event of
SOPRANO MEMS failing (and having to be restarted). If this event does occur, the message template needs to be
re-established by re-issuing startbatch and sendbatch commands.
https://apac.soprano.com.au/cgphttp/servlet/startbatch?template=Hi+^field2^,
+your+balance+is+^field3^
Response:
0 002 OK
Batch-ID: 241
https://apac.soprano.com.au/cgphttp/servlet/startbatch?template=Hi+^field1^,
+your+balance+is+^field2^&responseType=1
Response:
<response>
<message>
<success_code>0</success_code>
<response_code>002</response_code>
<response_string>OK</response_string>
<batch_id>1209139371</batch_id>
</message>
</response>
sendbatch
The sendbatch command is used to deliver the content for individual messages for a particular batch.
Each content parameter represents a single message and a msg_id is returned for each content parameter in the
sendbatch command.
Batch_ids are only relevant for a period of 24 hours after they were created, and are not persistent in the unlikely
event of the SOPRANO MEMS failing (and having to be restarted). If this event does occur, the message template
needs to be re-established by re-issuing startbatch and sendbatch commands.
Batches may only be used by the user who established them (by virtue of the previous statement, batches started by
one customer may only be used by that customer).
https://apac.soprano.com.au/cgphttp/servlet/sendbatch?
batch_id=241&content=61491234568,Joe,250&content=61498765432,Jane,100
Response:
0 001 OK
Message-ID: 12300016
61491234568 003
0 001 OK
Message-ID: 12300017
61498765432 003
Example: Send Batch Messages and Request XML Response (Invalid Content Value)
Request:
https://apac.soprano.com.au/cgphttp/sendbatch?
batch_id=61491234567&content=61491234568Joe,250&content=61498765432,Jane&res
ponseType=1
Response:
<response>
<message>
<success_code>1</success_code>
<response_code>040</response_code>
<response_string>ERROR</response_string>
<message_id/>
<destination>61491234568</destination>
<destination_code>108</destination_code>
<destination_description>PARAMS_FOR_TEMPLATE_NOT_MATCHED</
destination_description>
</message>
</response>
Care must be taken to ensure that the content values match with the corresponding numbered template fields.
Always check the destination value to determine whether there are any failed messages.
https://apac.soprano.com.au/cgphttp/servlet/sendbatch?
batch_id=24&content=61491234568,John100&content=61498765432,Mark,50&content=
61491234567,Paul,120
Response:
Request:
http://apac.soprano.com.au/cgphttp/sendbatch?
batch_id=241&content=61498765432,John,100&content=61491234568,Mark,50&conten
t=61491234567,Paul,120
Response:
Supported methods:
POST and GET ('POST' recommended)
HTTP and HTTPS
The POST or GET requests are to be initiated by the customer, and a response is returned from the SOPRANO
MEMS to the customer.
The unique ID of the destination Group or List is required. This can be found by logging into SOPRANO MEMS web
portal and viewing the relevant item in the 'Address Book' section.
Go to the 'Summary' page and click the required Group or List name.
1. Click 'Show all lists' or 'Show personal lists' in 'Address Book' drop-down menu (top of the web interface).
2. Click 'Show Lists' under 'Contacts/Groups/Lists' in 'Personal Setup' menu (left-hand side).
The 'List Summary' will be displayed. You can filter the results if you know any details, or click a List name in the
table.
The 'List Details' page will be displayed. You can find the List ID here.
To find a Group ID, go to 'Groups' section of your address book and follow the same procedure.
Request
Message submission using the POST method conforms to the following structure:
Request:
subAction=20&customMessage=test&orderDestLists=1489
The above example shows an SMS request where the destination is is a list. The destination list is determined by its
unique ID in the platform (1489 in above example).
Developers can send 1 request to multiple groups, multiple lists, or a combination of multiple groups and lists in the
same request.
To include multiple lists/groups, every item will need to be provided as a separate 'orderDestLists' or
'orderDestGroups' parameter in the request.
Response
Sample OK response:
{"ApiResponse":
{"StatusCode":1000,"TransactionId":"","Operation":"apiCreate",
"RecordId":6127,"ResponseTime":"2014-02-27T09:44:25
+08:00","StatusText":"Success"
,"RequestTime":"2014-02-27T09:44:25+08:00","Object":"SMSStandardOrderBean"}}
Commands
The following is a list of all parameters that may be included in the request.
then:
61491234567={1}
John={2}
Smith={3}
Groups
A Group is a set of Contacts. Each Group Contact has a number of details associated with it that can be
represented by text variables, which can be included in the 'messageContent' parameter.
subAction=20&customMessage=test&orderDestLists=1489
Response
{"ApiResponse":
{"StatusCode":1000,"TransactionId":"","Operation":"apiCreate",
"RecordId":6127,"ResponseTime":"2014-02-27T09:44:25
+08:00","StatusText":"Success"
,"RequestTime":"2014-02-27T09:44:25+08:00","Object":"SMSStandardOrderBean"}}
subAction=20&customMessage=test&orderDestGroups=1025
Response
{"ApiResponse":
{"StatusCode":1000,"TransactionId":"","Operation":"apiCreate",
"RecordId":6127,"ResponseTime":"2014-02-27T09:44:25
+08:00","StatusText":"Success"
,"RequestTime":"2014-02-27T09:44:25+08:00","Object":"SMSStandardOrderBean"}}
subAction=20&customMessage=test&orderDestLists=1561&orderDestLists=1234
Response
{"ApiResponse":
{"StatusCode":1000,"TransactionId":"","Operation":"apiCreate",
"RecordId":6127,"ResponseTime":"2014-02-27T09:44:25
+08:00","StatusText":"Success"
,"RequestTime":"2014-02-27T09:44:25+08:00","Object":"SMSStandardOrderBean"}}
subAction=20&customMessage=test&orderDestGroups=1025&orderDestGroups=1132
Response
{"ApiResponse":
{"StatusCode":1000,"TransactionId":"","Operation":"apiCreate",
"RecordId":6127,"ResponseTime":"2014-02-27T09:44:25
+08:00","StatusText":"Success"
,"RequestTime":"2014-02-27T09:44:25+08:00","Object":"SMSStandardOrderBean"}}
subAction=20&customMessage=test&orderDestGroups=1423&orderDestLists=1114
Response
{"ApiResponse":
{"StatusCode":1000,"TransactionId":"","Operation":"apiCreate",
"RecordId":6127,"ResponseTime":"2014-02-27T09:44:25
+08:00","StatusText":"Success"
,"RequestTime":"2014-02-27T09:44:25+08:00","Object":"SMSStandardOrderBean"}}
Request
subAction=20&customMessage=test
Response
{"ApiResponse":{"StatusCode":2000,"TransactionId":"","Data":"Valid
destination,
and\/or orderDestLists (list id) and\/or orderDestGroups (group id) and\/or
orderDestContacts (contact id) must be provided","Operation":"apiCreate",
"ResponseTime":"2014-02-27T10:21:51+08:00","StatusText":"Client
error","RequestTime":
"2014-02-27T10:21:44+08:00","Object":"SMSStandardOrderBean"}}
The same response would be returned for a request where 'orderDestGroups' or 'orderDestLists' were provided, but
paired with an invalid Group or List ID.
In this instance, the GET or POST operation is initiated by SOPRANO MEMS, and the response should be returned
by the customer. Typically, customer(s) will handle the incoming HTTP requests (SMS messages are processed by
SOPRANO MEMS and the parameters of this SMS are forwarded to customer's web application) using a web-
application running on a web server.
Note: If you are using an Inbound Campaign to forward messages to a URL, no retry attempts will be made.
Preferences
To set the interface as either HTTP POST or GET, log into the SOPRANO MEMS portal as a Customer Administrator
and go to the 'Company Setup' Section.
Setup > Company Setup > Customer Information > SMS Preference
Note: For POST responses the default character set encoding is UTF-8.
The option in this section 'Use Plain Text Email' refers to 'Forward to Email' and is unrelated to the HTTP interface.
Request
Example 1 (HTTP GET): When receiving a mobile-originated message, SOPRANO MEMS will submit a HTTP GET
Request to the customer's nominated URL (e.g. http://CUSTOMER_HOST_URL:PORT):
https://yoururl.com/yourapplication?destination=61491234568&text=Hello+
World&source=213123&networkSubmitTime=2011-11-16+10%3A26%
3A13&clientSubmitTime=2011-11-16+10%3A26%3A13
Example 2 (HTTP GET): including legacy fields, from and to which should no longer be used by the application as
from equals source and to equals destination.
https://yoururl.com/yourapplication?
destination=61491234568&clientMessageId=10332&source=61498765432&text=Hello
+World&from=61498765432&to=61491234568&networkSubmitTime=2011-11-16+10%3A26%
3A13&clientSubmitTime=2011-11-16+10%3A26%3A13
Note - New fields may be added, without notice, to the request parameters. Your interface should be developed by
extracting only the required fields, rather than raising an exception if an unsupported field is received.
Response
SOPRANO MEMS expects the customer’s server to reply with a HTTP status code of 200 (OK) if the SMS message
was successfully received. Any other status value will result in failure to deliver the message and the delivery of the
message to the nominated URL will not be re-attempted.
HTTP/1.1 200 OK
Server: Apache/1.3
Content-Type: text/plain
The response should be as minimal as possible and not contain any body.
Commands
The following is a list of all parameters that will be included in the HTTP GET Request to the customer's nominated
URL.
Figure: Flow from the platform delivering a message to when a delivery receipt is provided back to the platform
The format of the text that you will receive in the Delivery Report / Receipt message follows that defined in the open
SMPP Specification version 3.4. Available for download from: http://soprano.com.au/wp-content/uploads/2013/10/
SMPP_v3_4_Issue1_2.pdf
The fields of the above delivery receipt example are explained in the following table:
The following table describes the states that may be received from the network upon delivering a message.
WAP Push
The HTTP POST interface can be used to send WAP Push messages to a recipient’s handset.
Request
Response
Commands
Request
A valid submission of a WAP Push request may look like:
Where the customer’s username and password are provided within the Authorization header field. Refer to Section
2.1.1 for more details on the Authorization field.
Alternatively, if you do not wish to use the Basic Authentication method for your submission you may use the HTTP
parameters 'username' and 'password' to authenticate your request.
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?
username=demo@url.com.au&password=mypwd01&destination=61491234568&text=initi
al+test+message
If you provide both username and password in parameters AND in your Basic Authentication, the parameters will be
ignored and the Basic Authentication values will be used.
Response
The following response is an example response to the request above:
HTTP/1.1 200 OK
Server: Apache/1.3
Date: Mon, 05 Sep 2008 04:42:31 GMT
Content-Type: text/plain
Content-Length: 30
0 001 OK
Message-ID: 12300050
The body of all responses to WAP Push requests will contain a one digit success code (0 = success or 1 = error), a
three digit response code (refer to Table 2), a response string (refer to Table 2) and an identifier for the message.
If the request could not be interpreted (due to for example an unrecognised format, or the request lacking mandatory
parameters), the response will contain a success code of 2 (indicating an error with the command), a response
code (refer to Table 2) and a response string (refer to Table 2) identifying the error.
Example:
HTTP/1.1 200 OK
Server: Apache/1.3
Date: Mon, 21 Jun 2008 09:15:23 GMT
Content-Type: text/plain
Content-Length: 9
2 001 ERROR - command not recognised
Commands
Commands for WAP Push include:
sendwappush
sendwappush
The WAP Push framework allows information to be transmitted to a device without a user request. Only the service
indication method can be used with this command. Service loading cannot be used.
https://apac.soprano.com.au/sendwappush?
source=61491234568&destination=61498765432,61491234567&priority=1&url=wap.bl
ah.com/wap&message=Try%20this%20new%20stuff
Response:
0 005 OK
Message-ID: 12300053
Example: Send WAP Push message to multiple destinations with request xml response
Request:
https://apac.soprano.com.au/sendwappush?
source=61491234568&destination=61498765432&priority=1&url=wap.blah.com/
wap&message=Try%20this%20new%20stuff&responseType=1
Response:
<response>
<message>
<success_code>0</success_code>
<response_code>001</response_code>
<response_string>OK</response_string>
<message_id>1167</message_id>
</message>
</response>
Note: 'querymsg' can only be run on messages sent using 'sendmsg' request.
Request
A valid submission of a query request may look like:
Where the customer’s username and password are provided within the Authorization header field.
Alternatively, if you do not wish to use the Basic Authentication method for your submission you may use the HTTP
parameters 'username' and 'password' to authenticator your request.
msg_id=12179
username=demo@apac.soprano.com.au
password=mypwd01
If you provide both username and password in the URL parameters AND in Basic Authentication, the URL
parameters will be ignored and the Basic Authentication values will be used.
Response
The following response is valid for the request above:
HTTP/1.1 200 OK
Server: Apache/1.3
Date: Mon, 05 Sep 2008 05:42:31 GMT
Content-Type: text/plain
Content-Length: 43
0 003 OK
12179 ACCEPTED_BY_NETWORK_ELEMENT
The body of all responses to 'query' requests that were received successfully by SOPRANO MEMS will contain:
1 digit success code (e.g. '0' = Success or '1' = Error)
3 digit response code (e.g. '003')
Response string (e.g. 'OK' or 'ERROR')
an identifier for the message, containing the message ID (e.g. '12179') and the message status (e.g.
'ACCEPTED_BY_NETWORK_ELEMENT').
If the specified message ID is not found for the customer in SOPRANO MEMS, a sample error response may look
like:
HTTP/1.1 200 OK
Server: Apache/1.3
Date: Mon, 21 Jun 2004 09:12:23 GMT
Content-Type: text/plain
Content-Length: 35
1 050 ERROR
45051 MSG_ID_NOT_FOUND
Commands
Commands include:
querymsg
querymsg
The 'querymsg' command is used to query the status of SMSes sent to SOPRANO MEMS before.
Note: 'querymsg' can only be run on messages sent using 'sendmsg' request.
https://apac.soprano.com.au/cgphttp/servlet/querymsg?msg_id=12678
Response:
0 003 OK
12678 ACCEPTED_BY_NETWORK_ELEMENT
https://apac.soprano.com.au/cgphttp/servlet/querymsg?msg_id=12610
Response:
1 050 ERROR
12610 MSG_ID_NOT_FOUND
https://apac.soprano.com.au/cgphttp/servlet/querymsg?
msg_id=12678,12679,12680
Response:
0 003 OK
12678 ACCEPTED_BY_NETWORK_ELEMENT
12679 ACCEPTED_BY_NETWORK_ELEMENT
12680 ENROUTE_IN_CIQ
Example: Send Query Message - Long Concatenated Content Split into Multiple Parts
When a 'sendmsg' request is sent for a long message, it is split into 2 or more separate messages so it will be
received on the destination handset, but the response will only return a single message ID.
When 'querymsg' is sent for a msg_ID belonging to a split message, the response contains the original or 'parent'
msg_ID, as well as 'child' msg_IDs for the individual messages that were created.
Example:
Request:
https://apac.soprano.com.au/cgphttp/servlet/querymsg?msg_id=80661624
Response:
0 003 OK
80661624 CONCATENATE_SPLIT
80661625 ACCEPTED_BY_NETWORK_ELEMENT
80661626 ACCEPTED_BY_NETWORK_ELEMENT
Where:
80661624 = msg_id returned in response to original request
The POST operation is initiated by the customer, and the response returned by SOPRANO MEMS.
Request
A valid submission of a 'cancel' request may look like:
Where the customer’s username and password are provided within the Authorization header field. Refer to Section
2.1.1 for more details on the Authorization field.
Alternatively, if you do not wish to use the Basic Authentication method for your submission you may use the HTTP
parameters 'username' and 'password' to authenticate your request.
msg_id=12179
username=demo@apac.soprano.com.au
password=mypwd01
If you provide both username and password in the URL parameters AND in Basic Authentication, the URL
parameters will be ignored and the Basic Authentication values will be used.
Response
The following response is valid for the request above:
HTTP/1.1 200 OK
Server: Apache/1.3
Date: Mon, 05 Sep 2008 05:42:31 GMT
Content-Type: text/plain
Content-Length: 43
0 004 OK
The body of all responses to cancel requests that were received successfully by the SOPRANO MEMS will contain a
one digit success code (0 = success or 1 = error), a three digit response code (refer to Table 2), a response string
(refer to Table 2).
If SOPRANO MEMS cannot cancel the message(s) for some reason, an extra line of the response will contain the
message id and the message's current status. Refer to Table 3 for a list of possible message statuses and the
statuses that can be canceled.
HTTP/1.1 200 OK
Server: Apache/1.3
Date: Mon, 05 Sep 2008 05:42:31 GMT
Content-Type: text/plain
Content-Length: 43
1 050 ERROR
12179 ACCEPTED_BY_NETWORK_ELEMENT
If the msg_id specified is not found for the customer in SOPRANO MEMS, a sample response may look like:
HTTP/1.1 200 OK
Server: Apache/1.3
Date: Mon, 21 Jun 2004 09:12:23 GMT
Content-Type: text/plain
Content-Length: 35
1 050 ERROR
45051 MSG_ID_NOT_FOUND
Commands
Commands include:
cancelmsg
cancelmsg
The 'cancelmsg' command is used to cancel sending out an SMS through SOPRANO MEMS.
https://apac.soprano.com.au/cgphttp/servlet/cancelmsg?msg_id=12678
Response:
0 003 OK
12678 ACCEPTED_BY_NETWORK_ELEMENT
https://apac.soprano.com.au/cgphttp/servlet/querymsg?msg_id=12610
Response:
1 050 ERROR
12610 MSG_ID_NOT_FOUND
https://apac.soprano.com.au/cgphttp/servlet/cancelmsg?
msg_id=4566,4565,776576
Response:
1 050 ERROR
4566
4565 ACCEPTED_BY_CLIENT
776576 MSG_ID_NOT_FOUND
Appendices
HTTP WSDL SMPP SMTP SMTP OMS MM7 SMAP WCTP Java .NET
(Simple) (Standard) API
Send SMS
Send MMS
Scheduled Delivery
Registered Delivery
Cancel Message
Replace Message
Mobile Barcode
Passcode Authentication
* One time password for the HTTP interface requires Authenticator HTTP API.
API Functions
Function Description
Send SMS The protocol/API call provides the ability to send an SMS (Mobile Terminated
Short Message) to one or more destinations.
Send MMS The protocol/API call provides the ability to send an MMS (Mobile Terminated
Multimedia Message) to one or more destinations.
Receive Inbound SMS The protocol/API provides the ability to receive SMS (Mobile Originated Short
Messages) originating from a mobile device and deliver to a customer system in
real-time, or batched, using different time intervals (monthly, weekly, daily, hourly,
5 minutes).
Scheduled Delivery The protocol/API provides the ability to schedule a Mobile Terminated short
message for delivery at a time specified in the future.
Registered Delivery The protocol/API provides the ability to request a notification when the network
delivers a message to the mobile device.
A registered flag can be set on a message, prompting the mobile network to return
back a delivery receipt once the message is delivered to the device. Delivery
receipts are delivered the same way as an Inbound messages.
Delivery Receipts (or 'Delivery Reports') may not be fully supported across
interconnect (such as delivering a message from GSM to CDMA networks or when
delivering internationally).
Define Validity Period The protocol/API provides the ability to set the length of time the message may
reside in the mobile network SMSC without delivery (when a mobile handset is
switched off or unavailable).
Setting an expiry time for each message (e.g. 1 day or 8 hours) enables
messages to expire when not delivered within a desired period. This is useful for
Function Description
situations where the message is no longer relevant if not delivered within the
defined validity period.
Reply Control & Management The protocol/API provides the ability to control where replies (Mobile Originated/
Delivery Receipts or Reports) are to sent to in our system. This may be defined as
a web URL, email address, another mobile, or the platform database for reporting
purposes only.
While a default reply path exists within SOPRANO MEMS, this can be overwritten
using the API.
Source Address Control The protocol/API provides the ability to define the 'From' address that will appear
on the receiving mobile phone. This may be a Short Code / Vanity Short Code,
Long Code (standard international mobile number) or an Alpha Address (up to 11
characters).
Note: The available source addresses may be limited to one or more which have
been provisioned for the root customer specifically.
There are also some constraints when setting the source address which will
disable automatic reply management in the platform.
Transaction ID The protocol/API provides the ability to automatically manage sessions for
customers.
Send to Multiple Recipients The protocol/API provides the ability to send to multiple recipients in a single
request/API call.
Query Message Status The protocol/API provides the ability to query the status of a message for final
status updates (SMSC response or receipt update), using the message ID that
you receive from the platform after sending.
Cancel Message The protocol/API provides the ability to cancel a message that has been
scheduled or queued for future delivery, and has not been delivered to a mobile
device that is switched off or unavailable.
Replace Message The protocol/API provides the ability to override and replace the content of a
message that you have previously sent.
Limit Content to Single SMS Protocol/API preferences in the platform allow SMS messages to be truncated to a
maximum of 160 characters (1 SMS), which prevents long messages from being
generated.
This is applicable to SMTP (Email2SMS API, where an enterprise mail server may
append a footer to the email that is received by the platform).
Function Description
Long Concatenated Messages The protocol/API supports long messages (up to 1400 characters).
WAP Push (Si/SL) Messages The protocol/API provides the ability to send a WAP push (SI - Service Indicator
or SL - Service Loading) over SMS. These messages are limited to 140 octets and
may not be supported by all networks, or the current smart phone range.
One-Time Password The API (code) provides the ability to call a function that will generate a one-time
password, which can be used in the transmission of the SMS (one-time password
is then stored in a variable for your code to utilise upon challenging).
Secure Connection HTTPS The transport layer of communication with the platform is secured over an SSL
socket, utilising HTTPS.
Secure Tunnel (OpenSSL) The platform provides the ability to utilise Open SSL to set up a 'soft' VPN-type
connection, to secure communications protocols not already using SSL or
equivalent.
Username & Password Auth. The platform supports validation of API access using a username and password
Basic encoded with Basic Authentication method and transmitted in the HTTP header.
Username & Password Auth. The platform supports validation of API access using username and password
Parameters parameters transmitted in the GET / POST parameters.
User List Based Auth. The platform supports validation of API access by looking up a whitelist of allowed
senders (the sender does not have to be a platform user).
Passcode Auth. The platform supports validation of API access by checking a passcode in an
email subject line. This means that the sender of the message does not have to be
a platform user, and is typically used in conjunction with 'User List Based Auth.'.
Secure Domain IP Auth. The platform has the ability to lock down API access to a limited set of IP
addresses. IP address checking can be controlled in the Email API Preferences
for SMTP. All supported protocols require configuration by the provisioning team.
Appendix B - Abbreviations
API Application Programming Interface – a programmatic interface which enables an application to use
the facilities of SOPRANO MEMS.
CGP Corporate Gateway Platform – underlying technology of SOPRANO MEMS – mobile messaging
infrastructure which enables the sending and receipt of mobile messages.
HTTP Hypertext transfer protocol – an internet standard for transporting information to/from a web server.
Inbound Inbound messages – messages sent from a handset (i.e. 'MO' messages) arriving at SOPRANO
MEMS from the telecommunications network, to be forwarded to a SOPRANO MEMS customer.
MMS Multimedia messaging service – a mobile messaging service which enables the sending and receipt of
multi-part multi-media messages (text, picture, video, audio etc).
MO 'Mobile Originating' – inbound messages sent from a handset – to be routed to a SOPRANO MEMS
customer by SOPRANO MEMS.
MT 'Mobile terminated' – outbound messages sent by an application through SOPRANO MEMS to reach a
particular handset.
Outbound Outbound messages are messages sent by the SOPRANO MEMS (on instruction from a customer)
out through the telecommunications network to mobile handsets.
SMS Short Message Service – a mobile messaging service enabling the sending of short text and data
messages.
SMTP Simple Mail Transfer Protocol – a standard API used for email.
UDH UDH stands for User Data Header and is specialised information that is normally posted with 8-bit
messages. The UDH contains information on the message type, the length of a message,
concatenation and more. The UDH is specific to each manufacturer.
XML Extensible Markup Language – a flexible standard for formatting information exchanged between
applications.
Succe Respon Response String Explanation sen star sen que can WA sen sen WS
ss se dm tbat dba rym clm PP dba dm DL
sg ch tch sg sg ush rco ms
Code Code de
Succe Respon Response String Explanation sen star sen que can WA sen sen WS
ss se dm tbat dba rym clm PP dba dm DL
sg ch tch sg sg ush rco ms
Code Code de
Succe Respon Response String Explanation sen star sen que can WA sen sen WS
ss se dm tbat dba rym clm PP dba dm DL
sg ch tch sg sg ush rco ms
Code Code de
Succe Respon Response String Explanation sen star sen que can WA sen sen WS
ss se dm tbat dba rym clm PP dba dm DL
sg ch tch sg sg ush rco ms
Code Code de
078 ERROR – barcode Barcode width and height are too big
2 dimensions value for a barcode symbology or
exceeded messageType
079 ERROR – barcode Barcode width and height are too big
2 picture sise for a Nokia Picture Message
exceeded value barcode
2 080 ERROR - Ean8Barcode type/data is invalid or
Ean8Barcode not numeric
type/data is invalid
or not numeric
2 081 ERROR – invalid Format of the textFile is invalid or not
textFile format supported
2 082 ERROR – invalid Format of the audioFile is invalid or
audioFile format not supported
2 083 ERROR – invalid Format of the imageFile is invalid or
imageFile format not supported
2 084 ERROR – invalid Format of the videoFile is invalid or
videoFile format not supported
2 085 ERROR – An attachment is missing. The
attachment message will be sent without the
missing attachment
2 086 ERROR – invalid The length of costCentre exceeds the
costCentre max length(100)
2 087 ERROR – invalid The length of clientMessageId
clientMessageId exceeds the max length(100)
2 088 ERROR – invalid The content_type is invalid
content_type
2 089 ERROR – missing The default handset profile for the
default handset customer is not defined in database.
profile
2 090 ERROR – subject The length of subject exceeds the
too long max length
Some messages could have been successfully sent before SOPRANO MEMS went offline or encountered an error.
Therefore it is recommended to query the identifier to determine which (if any) messages were received. The
command parameters can then be adjusted accordingly before resubmitting the command.
Table 2 shows the possible status and state codes for an individual destination. These codes are used when Error 1
040 occurs.
When an error has occurred in relation to one particular recipient/destination, all destinations in the request and
their corresponding status will be reported. Since messages can be sent to multiple destinations within one HTTP
request, it could be possible for one destination to fail and others to succeed, as shown below:
HTTP/1.1 200 OK
Server: Apache/1.3
Date: Mon, 21 Jun 2004 09:12:23 GMT
Content-Type: text/plain
Content-Length: 22
1 040 ERROR
Message-ID: 12300011
61491234568 101
61491234567 001
Table 3 shows all the possible states for an outbound message returned when the user query a message status using
the querymsg or when the user attempts to cancel a message.
Status Description
ACCEPTED_BY_NETWORK_ELEMENT* Message has been sent to the network through SOPRANO MEMS
DELIVERED* Message has been delivered and a deliver receipt has been
received from the network
ENROUTE_IN_CIQ Message is queuing in SOPRANO MEMS
ENROUTE_IN_NOQ Message is queuing in SOPRANO MEMS
SCHEDULED_IN_CIQ Message is scheduled to be sent in SOPRANO MEMS
SCHEDULED_IN_NOQ Message is scheduled to be sent in SOPRANO MEMS
UNDELIVERABLE* Cannot send this message
EXPIRED* Message has been expired and will not be sent
DELETED Message has been canceled
REJECTED* Message has been rejected by the network
CONCATENATE_SPLIT* Message has been split into few child messages to send to the
network
SUBMIT_MULTI_SPLIT* Message has been split into few child messages to send to the
network
Error Code = <xxx>* Message failed to be sent as network rejected it with the error code.
The 'dcs' parameter is an optional parameter within the interface however it is required when sending a message to
an SMSC. Therefore, it is the SOPRANO MEMS responsibility to determine a value for the 'dcs' parameter when it
has not been included in a request. The 'dcs' value is dependent on the value of the contentType parameter, and
this is used (as described below) to set an appropriate value for the 'dcs' parameter (rather than applying a default
value for all messages).
If the 'dcs' parameter is not included AND the 'contentType' parameter is set to 2, 3, 4, 5 or 8, the SOPRANO
MEMS will set the 'dcs' value to 8-bit binary when submitting the message to the SMSC.
If the 'dcs' parameter is not included AND the 'contentType' parameter is set to 1, 6 or 7, the SOPRANO MEMS
should set the 'dcs' value to SMSC default alphabet when submitting the message to the SMSC.
If the 'dcs' parameter is included but is not set to 8-bit binary AND the 'contentType' parameter is set to 2, 3, 4, 5
or 8, an error will be returned.
If the 'dcs' parameter is included and set to 8-bit binary AND the 'contentType' parameter is set to 6 or 7, an error
will be returned.
Table 1 and Table 2 below explicitly define the behaviour of SOPRANO MEMS when both the 'dcs' and 'contentType'
parameters are included in a message for both the 'text' and 'data' parameters respectively.
Table 1: SOPRANO Mobile Enterprise Messaging Suite behaviour when 'dcs', 'contentType' and 'text' parameters
are included in an EMAIL message.
contentType
1 2 3 4 5 6 7 8
udh udh udh udh udh udh udh udh udh udh udh udh udh udh udh
absen prese absen prese absen prese absen prese abse prese abse prese abse prese abse udh
t nt t nt t nt t nt nt nt nt nt nt nt nt present
0 B C B C B C B C C C E F
1I I I I I I I I I I I I I I I I
2 H H H H H H H H H H H H H H H H
3 I I I I I I I I I I I I I I I I
dcs 4 A A B C B C B C B C D C D C E F
5 I I I I I I I I I I I I I I I I
6 I I I I I I I I I I I I I I I I
7I I I I I I I I I I I I I I I I
8 B C B C B C B C C C E F
Legend:
message accepted
A Invalid: 8-bit data is not text
(reject message and return error 2 030)
B Invalid: pictures and tones are not text
(reject message and return error 2 030)
C Combination of user-supplied and SOPRANO MEMS-generated udh not
supported in SOPRANO MEMS 4.0
(reject message and return error 2 029)
D Invalid: vCards/ vCalendars are text
(reject message and return error 2 023)
E Invalid: data including udh is not text
(reject message and return error 2 030)
F Combination of separate and integrated udh not supported in SOPRANO
MEMS 4.0
(reject message and return error 2 029)
H Set dcs value to 4 (refer to the behaviour for 4)
Table 2: SOPRANO MEMS behaviour when 'dcs', 'contentType' and 'data' parameters are included in an EMAIL
message
contentType
1 2 3 4 5 6 7 8
udh udh udh udh udh udh udh udh udh udh udh udh udh udh udh
absen prese absen prese absen prese absen prese abse prese abse prese abse prese abse udh
t nt t nt t nt t nt nt nt nt nt nt nt nt present
0 G C G C G C G C C C F
1I I I I I I I I I I I I I I I I
2 H H H H H H H H H H H H H H H H
3 I I I I I I I I I I I I I I I I
dcs 4 C C C C D C D C F
5 I I I I I I I I I I I I I I I I
6 I I I I I I I I I I I I I I I I
7I I I I I I I I I I I I I I I I
8 G C G C G C G C C C F
Legend:
message accepted
C Combination of user-supplied and SOPRANO MEMS-generated udh not
supported in SOPRANO MEMS 4.0
(reject message and return error 2 029)
D Invalid: vCards/ vCalendars are text
(reject message and return error 2 023)
F Combination of separate and integrated udh not supported in SOPRANO
MEMS 4.0
(reject message and return error 2 029)
G Invalid: pictures & tones are 8-bit data
(reject message and return error 2 022)
H Set dcs value to 4 (refer to the behaviour for 4)
I dcs value not supported by the SOPRANO MEMS 4.0
(reject message and return error 2 028)
Restrictions on the length of the text and data parameters are shown in the table below. Please note that the
restrictions identified below apply to messages that will not require concatenation. The SOPRANO MEMS can
guarantee the delivery of any message within these limits as a single SMS message.
content_type content field udh field dcs Restrictions for message delivery
as a single SMS message
1 text absent 0 (default) text length <= 160 characters
content_type content field udh field dcs Restrictions for message delivery
as a single SMS message
8 text length <= 70 characters
present 0 (default) text length <= 160 - (1 + udh length in
bytes) * 8 / 7 characters
Note: 'data length' and 'udh length' mean the length of the raw data represented by the supplied hexadecimal. For
example, '0a2b3c' has a length of 3 bytes.
<!DOCTYPE response [
<!ELEMENT response (message+)>
<!ELEMENT message (success_code,response_code,response_string,(message_id|
batch_id),destination?,destination_code?,destination_description?)>
<!ELEMENT success_code (#PCDATA)>
<!ELEMENT response_code (#PCDATA)>
<!ELEMENT response_string (#PCDATA)>
<!ELEMENT message_id ANY>
<!ELEMENT batch_id (#PCDATA)>
<!ELEMENT destination (#PCDATA)>
<!ELEMENT destination_code (#PCDATA)>
<!ELEMENT destination_description (#PCDATA)>
]>
url="http://apac.soprano.com.au/cgphttp/servlet/sendmsg?destination=61491234568&text=hello+world"
Options in the wget that are not mandatory depending on the deployment:
-v: Verbose
--no-check-certificate: to prevent validation of server certificates
$url='http://apac.soprano.com.au/cgphttp/servlet/sendmsg';
$destination='61491234568';
$text='Test the HTTP Interface';
$username='<<username>>';
$password='<<password>>';
$ua = LWP::UserAgent->new;
$req = HTTP::Request->new(GET => "$url?destination=$destination&text=$text");
$req->authorization_basic("$username", "$password");
print $ua->request($req)->as_string;
.NET
Dim oWeb As New System.Net.WebClient
Dim bytHeaders As Byte()
'code the username and password into basic authorization
bytHeaders = System.Text.ASCIIEncoding.UTF8.GetBytes("somebody@somewebsite.com.au" +
":" + "thepassword")
oWeb.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(bytHeaders))
oWeb.Headers.Add("Content-Type", "text/plain;charset=utf-8")
Perl
use MIME::Base64;
PHP
echo base64_encode("Aladdin:open sesame")."\n";
echo base64_decode("QWxhZGRpbjpvcGVuIHNlc2FtZQ==")."\n";
Python
print "Aladdin:open sesame".encode("base64")
print "QWxhZGRpbjpvcGVuIHNlc2FtZQ==".decode("base64")
Ruby
require 'base64'
XQuery (eXist-db)
let $encode := util:base64-encode('Aladdin:open sesame')
OpenSSL
$ printf "Aladdin:open sesame" | openssl enc -base64
QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Aladdin:open sesame
Server response
HTTP/1.0 200 OK
Server: HTTPd/1.0
Date: Sat, 27 Nov 2004 10:19:07 GMT
Content-Type: text/html
Content-Length: 10476
Appendix H - FAQ
1. How do I insert a new line in the message text using the HTTP API (HTTP GET request)?
URL encode the carriage return '%0D%0A' Example: text=Test+Message%0D%0ANew+Line.
E.g:
USER DETAILS:
Username: demo@apac.soprano.com.au
Password: XXXXXXXX
REQUEST URL:
https://apac.soprano.com.au/cgphttp/servlet/sendmsg?destination=61491234567&text=Test+Message%0D%0ANew
+Line
RESPONSE:
0 001 OK
Message-ID: 87121508