The process of enabling your website or application to send SMS using our service is easy. We have included a PHP example to help you. Our API supports 4 ways of connectivity - GET & POST requests, SOAP 1.1 & 1.2 protocols. Our staging system makes your coding painless. Please, see below for more details:
-
Step #0. Our developer staging system is here.
The output from the staging system will help you to check and debug your integration with our service. -
Step #1. Check your balance!
The method GetCreditBalance is used to check your balance. -
Step #2. Ready? Put a message on air!
The method SendMessage is used to send an SMS. -
Step #3. Check if messages are delivered!
The method GetMessageStatus is used to retrieve the status of sent SMS. -
Delivery Notification Callback
A way to get the status of sent SMS without polling the server. -
Virtual Number Callback
A way to get the incoming SMS received by your virtual number. - Examples
Staging system details
The staging system recognizes 9 special phone numbers. SMS sent to these numbers are not chargeable and not sent on air. Moreover the last digit in the numbers allows you to define what status a sent message will have. These numbers also work on our sms gateway, so you can use them to test site features such as Email2SMS as well as our API.Special Phone number | Associated message status |
---|---|
+0-000-000-000-1 | Awaiting result |
+0-000-000-000-2 | Sending message.. |
+0-000-000-000-3 | Delivered to carrier |
+0-000-000-000-4 | Delivered to handset |
+0-000-000-000-5 | Error with message |
+0-000-000-000-6 | User cancelled message delivery |
+0-000-000-000-7 | Error delivering message |
+0-000-000-000-8 | OK |
+0-000-000-000-9 | Routing error |
GetCreditBalance
Input- username (your login on our site)- password (your SMS secret on our site) Output- a figure which tells you how much credits do you have |
TestIf you have joined our service, please login with your username and password on our homepage. |
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /api/sms.asmx HTTP/1.1 Host: www.160.com.au Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "www.160.com.au/api/GetCreditBalance" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetCreditBalance xmlns="www.160.com.au/api"> <username>string</username> <password>string</password> </GetCreditBalance> </soap:Body> </soap:Envelope>
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetCreditBalanceResponse xmlns="www.160.com.au/api"> <GetCreditBalanceResult>string</GetCreditBalanceResult> </GetCreditBalanceResponse> </soap:Body> </soap:Envelope>
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /api/sms.asmx HTTP/1.1 Host: www.160.com.au Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GetCreditBalance xmlns="www.160.com.au/api"> <username>string</username> <password>string</password> </GetCreditBalance> </soap12:Body> </soap12:Envelope>
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GetCreditBalanceResponse xmlns="www.160.com.au/api"> <GetCreditBalanceResult>string</GetCreditBalanceResult> </GetCreditBalanceResponse> </soap12:Body> </soap12:Envelope>
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample HTTP GET request and response. The placeholders shown need to be replaced with actual values.
GET /api/sms.asmx/GetCreditBalance?username=string&password=string HTTP/1.1 Host: www.160.com.au
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <string xmlns="www.160.com.au/api">string</string>
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.
POST /api/sms.asmx/GetCreditBalance HTTP/1.1 Host: www.160.com.au Content-Type: application/x-www-form-urlencoded Content-Length: length username=string&password=string
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <string xmlns="www.160.com.au/api">string</string>
SendMessage
Input- username (your login on our site)- password (your SMS secret on our site) - mobileNumber (the mobile number of your recipient) --- only one number per request is allowed --- non numeric symbols in the number will be ignored --- if the number starts with zero, it will mean the recipient is from Australia - messageText (the SMS message you want to send) --- use UTF-8 encoding if you are using international symbols in the message - senderName (the text you specify here appears instead your mobile number. SenderName is optional. You can also use your virtual number inside this field.) --- Sender name is limited between 3 and 11 alphanumeric characters. Allowed characters are a-z 0-9 _ ! @ # $ % * ( ) - + = . ? / ' : space - sms2way (the email address where you want to receive the reply to your SMS. SMS2way is optional) - delay (a number of minutes that you want to postpone your message. Delay is optional) --- Delay is in minutes and must be an integer between 1 and 44640. Please note that there are 44640 minutes in 31 days so the maximum delay you can set is 31 days - callbackurl (an URL to send delivery notifications to. See details. Callbackurl is optional) Output- a string which contains:--- a messageId of the message sent (this is used later to check the message status in step 3), --- or an error message in the format "ERR: error description", if an error occurs |
TestIf you have joined our service, please login with your username and password on our homepage. |
Multiple SMS: Input
You can send more than one SMS at once with our API. To do this you should list the recipient's mobile numbers in the mobileNumber fields, with a unique id defined in the square brackets. The id should be alphanumeric. For example, a request below will send "text_here" SMS to 2 mobile number 0417027121 and 0413456787messageText=text_here&mobileNumber[1]=0417027121&mobileNumber[test1]=0413456787&...
Note: In our example above we have used [1] and [test1] as our id, but it can be alphanumeric value.
You can also send each recipient their own unique SMS. To do this, you need to use messageText fields in the same format as mobileNumber. The id, assigned to the mobileNumber, should be the same id, assigned to the messageText. For example, a request below will send "Hi Michael" to the 0417027121, and "Hi Andrew" to the 0413456787.
messageText[1]=Hi%20Michael&messageText[test1]=Hi%20Andrew&mobileNumber[1]=0417027121&mobileNumber[test1]=0413456787&...
The same technique can be used for senderName, sms2way and the delay field(s).
In the SOAP versions, you need to group uncommon values to the <sms> container. The container should be repeated one time minimum. So, the examples above will look like:
<messageText>text_here</messageText> <sms> <id>1</id> <mobileNumber>0417027121</mobileNumber> </sms> <sms> <id>test1</id> <mobileNumber>0413456787</mobileNumber> </sms> |
<sms> <id>1</id> <mobileNumber>0417027121</mobileNumber> <messageText>Hi Michael</messageText> </sms> <sms> <id>test1</id> <mobileNumber>0413456787</mobileNumber> <messageText>Hi Andrew</messageText> </sms> |
Multiple SMS: Output
The status tag can only have 2 values, OK or NOK. If the value is OK, all SMS were sent. NOK value means none of SMS were sent.<sms> container keeps id and messageId in case of success, or error descriptions in case of failure. There is a special id - COMMON - which indicates common errors if any.
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /api/sms.asmx HTTP/1.1 Host: www.160.com.au Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "www.160.com.au/api/SendMessage" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <SendMessage xmlns="www.160.com.au/api"> <username>string</username> <password>string</password> <mobileNumber>string</mobileNumber> <messageText>string</messageText> </SendMessage> </soap:Body> </soap:Envelope>
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <SendMessageResponse xmlns="www.160.com.au/api"> <SendMessageResult>string</SendMessageResult> </SendMessageResponse> </soap:Body> </soap:Envelope>
POST /api/sms.asmx HTTP/1.1 Host: www.160.com.au Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "www.160.com.au/api/SendMessage" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <SendMessage xmlns="www.160.com.au/api"> <username>string</username> <password>string</password> <sms> <id>string</id> <mobileNumber>string</mobileNumber> <messageText>string</messageText> </sms> </SendMessage> </soap:Body> </soap:Envelope>
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <SendMessageResponse xmlns="www.160.com.au/api"> <SendMessageResult> <status>string</status> <sms> <id>string</id> <message>string</message> </sms> </SendMessageResult> </SendMessageResponse> </soap:Body> </soap:Envelope>
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /api/sms.asmx HTTP/1.1 Host: www.160.com.au Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <SendMessage xmlns="www.160.com.au/api"> <username>string</username> <password>string</password> <mobileNumber>string</mobileNumber> <messageText>string</messageText> </SendMessage> </soap12:Body> </soap12:Envelope>
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <SendMessageResponse xmlns="www.160.com.au/api"> <SendMessageResult>string</SendMessageResult> </SendMessageResponse> </soap12:Body> </soap12:Envelope>
POST /api/sms.asmx HTTP/1.1 Host: www.160.com.au Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <SendMessage xmlns="www.160.com.au/api"> <username>string</username> <password>string</password> <sms> <id>string</id> <mobileNumber>string</mobileNumber> <messageText>string</messageText> </sms> </SendMessage> </soap12:Body> </soap12:Envelope>
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <SendMessageResponse xmlns="www.160.com.au/api"> <SendMessageResult> <status>string</status> <sms> <id>string</id> <message>string</message> </sms> </SendMessageResult> </SendMessageResponse> </soap12:Body> </soap12:Envelope>
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample HTTP GET request and response. The placeholders shown need to be replaced with actual values.
GET /api/sms.asmx/SendMessage?username=string&password=string&mobileNumber=string&messageText=string HTTP/1.1 Host: www.160.com.au
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <string xmlns="www.160.com.au/api">string</string>
GET /api/sms.asmx/SendMessage?username=string&password=string&mobileNumber[id]=string&messageText[id]=string HTTP/1.1 Host: www.160.com.au
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <result> <status>string</status> <sms> <id>string</id> <message>string</message> </sms> </result>
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.
POST /api/sms.asmx/SendMessage HTTP/1.1 Host: www.160.com.au Content-Type: application/x-www-form-urlencoded Content-Length: length username=string&password=string&mobileNumber=string&messageText=string
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <string xmlns="www.160.com.au/api">string</string>
POST /api/sms.asmx/SendMessage HTTP/1.1 Host: www.160.com.au Content-Type: application/x-www-form-urlencoded Content-Length: length username=string&password=string&mobileNumber[id]=string&messageText[id]=string
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <result> <status>string</status> <sms> <id>string</id> <message>string</message> </sms> </result>
GetMessageStatus
Input- username (your login on our site)- password (your SMS secret on our site) - messageId of sent message (what was received on 2nd step) Output- a string which contains:--- or a string of the message status --- or an error message in the format "ERR: error description", if an error occurs |
TestIf you have joined our service, please login with your username and password on our homepage. |
Multiple SMS: Input
You can retrieve the status of multiple SMS. To do this list message id in the messageId fields which have unique id defined in the square brackets. Please note that id must be alphanumeric. For example, a request below will return data for 2 messages.messageId[1]=api123&messageId[test1]=api124&...
Multiple SMS: Output
There is a common tag status which is always OK.<sms> container keeps id, code and message. message contains the same info as a string tag in the previous version. code can have 4 values:
- -1: an error
- 0: SMS is idle
- 1: transmission was a success
- 2: transmission failed
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /api/sms.asmx HTTP/1.1 Host: www.160.com.au Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "www.160.com.au/api/GetMessageStatus" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetMessageStatus xmlns="www.160.com.au/api"> <username>string</username> <password>string</password> <messageId>string</messageId> </GetMessageStatus> </soap:Body> </soap:Envelope>
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetMessageStatusResponse xmlns="www.160.com.au/api"> <GetMessageStatusResult>string</GetMessageStatusResult> </GetMessageStatusResponse> </soap:Body> </soap:Envelope>
POST /api/sms.asmx HTTP/1.1 Host: www.160.com.au Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "www.160.com.au/api/GetMessageStatus" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetMessageStatus xmlns="www.160.com.au/api"> <username>string</username> <password>string</password> <sms> <id>string</id> <messageId>string</messageId> </sms> </GetMessageStatus> </soap:Body> </soap:Envelope>
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetMessageStatusResponse xmlns="www.160.com.au/api"> <GetMessageStatusResult> <sms> <id>string</id> <code>string</code> <message>string</message> </sms> </GetMessageStatusResult> </GetMessageStatusResponse> </soap:Body> </soap:Envelope>
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /api/sms.asmx HTTP/1.1 Host: www.160.com.au Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GetMessageStatus xmlns="www.160.com.au/api"> <username>string</username> <password>string</password> <messageId>string</messageId> </GetMessageStatus> </soap12:Body> </soap12:Envelope>
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GetMessageStatusResponse xmlns="www.160.com.au/api"> <GetMessageStatusResult>string</GetMessageStatusResult> </GetMessageStatusResponse> </soap12:Body> </soap12:Envelope>
POST /api/sms.asmx HTTP/1.1 Host: www.160.com.au Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GetMessageStatus xmlns="www.160.com.au/api"> <username>string</username> <password>string</password> <sms> <id>string</id> <messageId>string</messageId> </sms> </GetMessageStatus> </soap12:Body> </soap12:Envelope>
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GetMessageStatusResponse xmlns="www.160.com.au/api"> <GetMessageStatusResult> <sms> <id>string</id> <code>string</code> <message>string</message> </sms> </GetMessageStatusResult> </GetMessageStatusResponse> </soap12:Body> </soap12:Envelope>
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample HTTP GET request and response. The placeholders shown need to be replaced with actual values.
GET /api/sms.asmx/GetMessageStatus?username=string&password=string&messageId=string HTTP/1.1 Host: www.160.com.au
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <string xmlns="www.160.com.au/api">string</string>
GET /api/sms.asmx/GetMessageStatus?username=string&password=string&messageId[id]=string HTTP/1.1 Host: www.160.com.au
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <result> <sms> <id>string</id> <code>string</code> <message>string</message> </sms> </result>
POST | GET | SOAP 1.1 | SOAP 1.2 |
The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.
POST /api/sms.asmx/GetMessageStatus HTTP/1.1 Host: www.160.com.au Content-Type: application/x-www-form-urlencoded Content-Length: length username=string&password=string&messageId=string
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <string xmlns="www.160.com.au/api">string</string>
POST /api/sms.asmx/GetMessageStatus HTTP/1.1 Host: www.160.com.au Content-Type: application/x-www-form-urlencoded Content-Length: length username=string&password=string&messageId[id]=string
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <result> <sms> <id>string</id> <code>string</code> <message>string</message> </sms> </result>
Delivery Notification Callback
- In the SendMessage API you may set a callbackurl param. It should be a HTTP/HTTPS URL we will send delivery notifications to. - After changing of the SMS status, the callback script is received a POST request with the following values:
|
Virtual Number Callback
- You may configured your Virtual Number to receive incoming SMS to your server. To do that you need to set a HTTP/HTTPS URL we will send the incoming SMS to. - When a new incoming SMS is received, the callback script is received a POST request with the following values:
|