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:
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
|
Test
If you have joined our service, please login with your username and password on our homepage.
|
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.smspal.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "www.smspal.com/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.smspal.com/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.smspal.com/api">
<GetCreditBalanceResult>string</GetCreditBalanceResult>
</GetCreditBalanceResponse>
</soap:Body>
</soap:Envelope>
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.smspal.com
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.smspal.com/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.smspal.com/api">
<GetCreditBalanceResult>string</GetCreditBalanceResult>
</GetCreditBalanceResponse>
</soap12:Body>
</soap12:Envelope>
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.smspal.com
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.smspal.com/api">string</string>
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.smspal.com
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.smspal.com/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
|
Test
If 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
0413456787
messageText=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.
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.smspal.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "www.smspal.com/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.smspal.com/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.smspal.com/api">
<SendMessageResult>string</SendMessageResult>
</SendMessageResponse>
</soap:Body>
</soap:Envelope>
POST /api/sms.asmx HTTP/1.1
Host: www.smspal.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "www.smspal.com/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.smspal.com/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.smspal.com/api">
<SendMessageResult>
<status>string</status>
<sms>
<id>string</id>
<message>string</message>
</sms>
</SendMessageResult>
</SendMessageResponse>
</soap:Body>
</soap:Envelope>
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.smspal.com
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.smspal.com/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.smspal.com/api">
<SendMessageResult>string</SendMessageResult>
</SendMessageResponse>
</soap12:Body>
</soap12:Envelope>
POST /api/sms.asmx HTTP/1.1
Host: www.smspal.com
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.smspal.com/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.smspal.com/api">
<SendMessageResult>
<status>string</status>
<sms>
<id>string</id>
<message>string</message>
</sms>
</SendMessageResult>
</SendMessageResponse>
</soap12:Body>
</soap12:Envelope>
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.smspal.com
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.smspal.com/api">string</string>
GET /api/sms.asmx/SendMessage?username=string&password=string&mobileNumber[id]=string&messageText[id]=string HTTP/1.1
Host: www.smspal.com
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>
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.smspal.com
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.smspal.com/api">string</string>
POST /api/sms.asmx/SendMessage HTTP/1.1
Host: www.smspal.com
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
|
Test
If 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
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.smspal.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "www.smspal.com/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.smspal.com/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.smspal.com/api">
<GetMessageStatusResult>string</GetMessageStatusResult>
</GetMessageStatusResponse>
</soap:Body>
</soap:Envelope>
POST /api/sms.asmx HTTP/1.1
Host: www.smspal.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "www.smspal.com/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.smspal.com/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.smspal.com/api">
<GetMessageStatusResult>
<sms>
<id>string</id>
<code>string</code>
<message>string</message>
</sms>
</GetMessageStatusResult>
</GetMessageStatusResponse>
</soap:Body>
</soap:Envelope>
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.smspal.com
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.smspal.com/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.smspal.com/api">
<GetMessageStatusResult>string</GetMessageStatusResult>
</GetMessageStatusResponse>
</soap12:Body>
</soap12:Envelope>
POST /api/sms.asmx HTTP/1.1
Host: www.smspal.com
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.smspal.com/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.smspal.com/api">
<GetMessageStatusResult>
<sms>
<id>string</id>
<code>string</code>
<message>string</message>
</sms>
</GetMessageStatusResult>
</GetMessageStatusResponse>
</soap12:Body>
</soap12:Envelope>
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.smspal.com
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.smspal.com/api">string</string>
GET /api/sms.asmx/GetMessageStatus?username=string&password=string&messageId[id]=string HTTP/1.1
Host: www.smspal.com
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>
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.smspal.com
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.smspal.com/api">string</string>
POST /api/sms.asmx/GetMessageStatus HTTP/1.1
Host: www.smspal.com
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>