SMS HTTP API Documentation
Jump to Section
- Send SMS Parameters
- Text SMS
- Flash SMS
- Unicode SMS
- Unicode Flash SMS
- Other Language SMS
- Bulk SMS Sending
- XML API
- JSON API
- Send SMS Status/Error Code Description
- Balance Check Parameters
- Balance Check Status/Error Code Description
- Delivery Status Check Parameters
- Delivery Check Status/Error Code Description
- Sample Codes
This technical document is intended for API developers who wish to use the Tubelight Communications Ltd. HTTP API for sending messages, receiving delivery reports and checking account balances.
The document describes the various programming models and commands used by developers when using this API.
The HTTP API could be used for both low and high end messaging services. HTTP is a means for relaying information; the HTTP API can be used with practically any web service application. This is particularly useful for high volume message sending.
The HTTP API offers various methods of sending and receiving SMS messages. The document contains specifications for the following methods.
Send messages using HTTP GET.
Receive responses using HTTP GET.
Protocol: HTTP (We also provide SMPP protocol)
Functions: Send SMS, Flash SMS, Unicode SMS, Balance Check, Delivery Reports and Time Scheduling
Send SMS Parameters
Base URL: https://smsc.webpostservice.com/sendsms/sendsms.php
|username (required)||Account Username|
|password (required)||Account Password|
|type (required)||Message Type|
|mobile (required)||Mobile Number / MSISDN / Destination Number|
|sender (required)||Valid Source Address (Note: Alphabetic 6 characters are valid sender id.)|
|message (required)||Message Body (Note: Message body must be urlencoded)|
|schedule||Valid schedule parameters is 1 which indicates message is forced for Scheduling.|
|datetime||Valid date time parameter indicates the timestamp when the message should be triggered on handset eg., 2010-03-14 09:30 (Note: date time parameter must be urlencoded.)|
|gmt||This specifies according to which gmt the datetime should act to Send sms to get delivered on the mobile.|
|credits||Valid credits parameters is 1 which returns number of credits Deducted in response with the message id separated by “|”.|
Text SMS example with message body “Testing HTTP API”
Text SMS example with message body “Testing åäö”
Flash SMS example with message body “Demo Message”
Unicode SMS example with Unicode body.
Unicode Flash SMS
Unicode Flash SMS example with unicode body.
Other Language SMS
Other language sms body could be used to send Arabic, Hindi messages directly to our interface without any conversion.
Bulk SMS Sending
Bulk SMS sending text sms example.
Body param should be urlencode.
Send SMS Status/Error Code Description
|SUBMIT_SUCCESS | xxxxxxxx-xxxx-xxxx- xxxx-xxxxxxxxxxxx||If message is submitted successfully on sms gateway you will receive “SUBMIT_SUCCESS” message as an response code with 32 digit Message id separated by dash.|
|ERR_PARAMETER||The status code is returned if there is some missing parameter or sendsms URL is malformed.|
|ERR_MOBILE||The status code is returned for an invalid mobile number or if it is greater than 14 and less than 10.|
|ERR_SENDER||The error code is returned for an invalid sender id or if sender id is Alphabetic and 6 characters long.|
|ERR_MESSAGE_TYPE||The error code is returned in case if message type being submitted is
(Note: Valid Parameters accepted should be in format either [TEXT, UNICODE, FLASH, UNICODE-FLASH])
|ERR_MESSAGE||This is returned in case if message is malformed or is not valid.|
|ERR_SPAM||The response code is returned in case if message is recognized as spam.|
|ERR_DLR||The response code is returned when dlr requisition is invalid.|
|ERR_USERNAME||The response code is returned if username is not formed well that is for invalid characters other than [a-z, A-Z, 0-9, -]|
|ERR_PASSWORD||This is returned if password is not formed well that is for invalid characters other than [a-z, A-Z, 0-9, -]|
|ERR_LOGIN||The response code is returned in case if user is not a valid user within the system which could be due to incorrect login parameters for|
|ERR_CREDIT||The response code is returned in case if user has insufficient balance in His account for processing the message.|
|ERR_SCHEDULE||Optional default is 0, but in case if schedule is passed so default value Should be either 0 or 1 where 1 is to force scheduling for the|
|ERR_DATETIME||The error code is returned if you have specified invalid datetime format.|
|ERR_GMT||This status code is returned in case you have specified invalid gmt.
(Note: Valid GMT's are [-12:00 -11:00 -10:00 -09:00 -08:00 -07:00 -06:00 -05:00 -04:00 -03:30 -03:00 -02:00 -01:00 -00:00 01:00 02:00 03:00 03:30 04:00 04:30 05:00 05:30 05:45 06:00 06:30 07:00 08:00 09:00 09:30 10:00 11:00 12:00 13:00])
|ERR_ROUTING||The response code is returned in case you are sending on invalid routing Not specified for your account. To get avail for any targeted destinations You need to contact your customer’s relation officer.|
|ERR_INTERNAL||The response code is returned in case of any internal issue or server Down for maintenance.|
|ERR_DND||The response code is returned in case you are sending Message on DND numbers. Error code for this is100.|
|ERR_SENDER_ID_NOT_APPROVED||The response code is returned in case when Sender Id is not approved. Error code for this is1038.|
Balance Check Parameters
Base URL: https://smsc.webpostservice.com/sendsms/checkbalance.php
Balance Check URL:
Balance check example.
Balance Check Status/Error Code Description
|ERR_LOGIN||The response code is returned in case if user is not a valid user within the system which could be due to incorrect login Parameters for username or password.|
|ERR_USERNAME_PASSWORD||The response code is returned if username or password is not formed well that is for invalid characters other than [a-z, A-Z, 0-9, -]|
Delivery Status Check Parameters
Base URL: https://smsc.webpostservice.com/sendsms/dlrstatus.php
|Message ID||SMS Message ID|
Delivery Status Check URL:
Delivery Status Check Example
Delivery Check Status/Error Code Description
|ERR_LOGIN||The response code is returned if user login is invalid in System.|
|ERR_USERNAME_PASSWORD||The response code is returned if username or password is not formed well that is for invalid characters other than [a-z, A-Z, 0-9, -].|
|ERR_MSGID||The response code is returned in case of wrong or invalid Message id.|
|DELIVRD||Delivered to destination|
|ACCEPTD||Accepted by network operator|
|UNDELIV||Message is undeliverable|
|EXPIRED||Validity period has expired|
|REJECTD||Message is in rejected state|
|DELETED||Message is deleted due to flood control mechanism.|
|UNKNOWN||Message is in unknown state|
|NACK/DISCARDED||Message discarded due to number being barred.|
|NACK/REJECTED||Message is in rejected state.|
|NACK/MALFORMED SMS||Message is malformed due to invalid message body or Spam.|
|NACK/69/Submit failed||Message submission failed due to MSISDN not reachable.|
|NACK/10/Invalid Source Address||Message submission failed due to source invalid.|
|NACK/11/Invalid Destination Address||Message submission failed due to MSISDN invalid.|
|NACK/74/Unknown/Reserved||Message is in unknown state or source is reserved.|
$password = "123";
$message = urlencode("This is an example message");
$url=$baseurl."?username=".$username."&password=".$password."&type=".$type."&sender=".$sender."& mobile=".$mobile."&message=".$message ;
$return = file($url);
list($send,$msgcode) = split('[|]',$return);
if ($send == "SUBMIT_SUCCESS")
echo "Message sent successfully";
echo "send message failed";
$username : Username provided by Our Team .
$password : Password provided by Our Team .
$type : This will be type of SMS i.e, TEXT, FLASH,UNICODE etc.
$sender : Sender Id allocated to you. (For promotion account "Alerts" is default sender id.)
$mobile : Receiver Mobile Number.
$message : SMS content.
$baseurl : URL of purpose
(For Bulk->https:// smsc.webpostservice.com /sendsms/bulksms)
WebClient htpclient = new WebClient ();
htpclient.QueryString.Add("message", "This is an example message");
string baseurl =" https://smsc.webpostservice.com/sendsms/sendsms.php ";
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader (data);
string s = reader.ReadToEnd ();