Developer Zone

HTTP API Documentation

Contact Sales

Introduction

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.

Host: www.webpostservice.com
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: http://www.webpostservice.com/sendsms/sendsms.php

Mandatory Parameters:

Parameter Name Description
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)

Optional Parameters:

Parameter Name Description
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

Text SMS example with message body “Testing HTTP API”

Example GET URL : http://www.webpostservice.com/sendsms/sendsms.php?username=yourusername&password=yourpassword&type=TEXT&sender=Alerts&mobile= 9000000000&message=Testing%20HTTP%20API

Text SMS example with message body “Testing åäö”

Example GET URL : http://www.webpostservice.com/sendsms/sendsms.php? username=yourusername&password=yourpassword&type=TEXT&sender=Alerts&mobile= 9000000000&message=Testing%20%e4%e5%f6

Flash SMS

Flash SMS example with message body “Demo Message”

Example GET URL : http://www.webpostservice.com/sendsms/sendsms.php? username=XXXX&password=YYYYY&type=FLASH&mobile=9000000000&sender=Alerts&message=Sendsms%20URL%20Demo%20Message

Unicode SMS

Unicode SMS example with Unicode body.

http://www.webpostservice.com/sendsms/sendsms.php? username=XXXX&password=YYYYY&type=UNICODE&mobile=9000000000&sender=Alerts&message=इण्टरनेट पर हिन्दी के साधन

Unicode Flash SMS

Unicode Flash SMS example with unicode body.

http://www.webpostservice.com/sendsms/sendsms.php? username=XXXX&password=YYYYY&type=UNICODE- FLASH&mobile=9000000000&sender=Alerts&message= message=इण्टरनेट पर हिन्दी के साधन

Other Language SMS

Other language sms body could be used to send Arabic, Hindi messages directly to our interface without any conversion.

http://www.webpostservice.com/sendsms/sendsms.php? username=XXXX&password=YYYYY&type=OTHER&mobile=9000000000&sender=Alerts B&message=test%20messsage

Bulk SMS Sending

Bulk SMS sending text sms example.

http://www.webpostservice.com/sendsms/groupsms.php? username=XXXX&password=YYYYY&type=TEXT&mobile=90000xxxxx,91111xxxxx,92222xxxxx&sender=Alerts&message=Sendsms%20URL%20Demo%20Message

XML API

XML Request:

URL: http://www.webpostservice.com/sendsms/xmlsms.php
Body param should be urlencode.

http://www.webpostservice.com/sendsms/xmlsms.php?body=urlencode(
<?xml version='1.0' encoding='UTF-8'?>
<message>
<login username="xxxxxx" password="xxxxxx">
<sms to="9860xxxxxx" sender="UPDATE" type="TEXT" message="hi>"></sms>
<sms to="8828xxxxxx" sender="UPDATE" type="TEXT" message="hi>"></sms>
</login>
</message>
)

XML Request:

<dlr>
<response id=" a824xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx " status="SUBMIT_SUCCESS "/>
<response id=" a824xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx " status="SUBMIT_SUCCESS "/>
</dlr>

JSON API

XML Response:

webpostservice.com/sendsms/jsonapi.php?url={"auth":{"username":"XXXXX","password":"XXXX"},"SMS":[{"senderId":"UPDATE","mobile":"831832XXXX","message":"Hello+Test+Message","type":"TEXT"},{"senderId":"UPDATE","mobile":"831832XXXX","message":"Hello+Test+Message","type":"TEXT"} ]}

Request Format:

{"auth":{"username":"XXXXX","password":"XXXXX"}, "SMS":[{"senderId":"UPDATE","mobile":"831832XXXX","message":"Hello+Test+Message","type":"TEXT"} ] }

Response Format:

{"ERR":{"cause":"invalid","code":"1309"}}

Send SMS Status/Error Code Description

Status Codes 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 Not valid.

(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: http://www.webpostservice.com/sendsms/checkbalance.php

Parameter Name Description
username Account Username
password Account Password

Balance Check URL:

Balance check example.

http://www.webpostservice.com/sendsms/checkbalance.php?username=XXXX&password=YYYYY

Balance Check Status/Error Code Description

Status Codes 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: http://www.webpostservice.com/sendsms/dlrstatus.php

Parameter Name Description
Username Account Username
Password Account Password
Message ID SMS Message ID

Delivery Status Check URL:

Delivery Status Check Example

http://www.webpostservice.com/sendsms/dlrstatus.php? username=XXXX&password=YYYYY&messageid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Delivery Check Status/Error Code Description

Status Codes 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.

Sample Codes

PHP code:

<?
$username="abc";
$password = "123";
$type ="text";
$sender="senderName";
$mobile="1234567890";
$message = urlencode("This is an example message");
$baseurl ="http://103.241.147.169/sendsms/sendsms.php"
$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";
}
else
{
echo "send message failed";
}
exit();
?>

Note:

$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 single->http://www.webpostservice.com/sendsms/sendsms)
(For Bulk->http:// www.webpostservice.com /sendsms/bulksms)

C# code:

    using System.Net;
using System.IO;
WebClient htpclient = new WebClient ();
htpclient.QueryString.Add("username", "xxxx");
htpclient.QueryString.Add("password", "xxxx");
htpclient.QueryString.Add("type", "TEXT");
htpclient.QueryString.Add("sender", "xxxx");
htpclient.QueryString.Add("mobile", "xxxx");
htpclient.QueryString.Add("message", "This is an example message");
string baseurl =" http://103.241.147.169/sendsms/sendsms.php ";
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader (data);
string s = reader.ReadToEnd ();
data.Close ();
reader.Close ();
return (s);

Introduction

This technical document is intended for API developers who wish to use the Tubelight Communications Ltd HTTP API for Voice.

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 voice services. HTTP is a means for relaying information; the HTTP API can be used with practically any web service application.

The HTTP API offers various methods of Voice API. The document contains specifications for the following methods.

Send messages using HTTP POST.
Receive responses using HTTP GET.

Host: http://tubelight.cloud/voiceapi/
Protocol: HTTP
Functions: Call-obd-single

Send call-obd-single Parameters

Base URL: http://tubelight.cloud/voiceapi/single-obd-api.php

Where Mandatory Parameters are:

Parameter Name Description
call_start_time call start time
call_end_time call last send time
retry_unit number of retry unit
retry_gap time period gap between retry
username User name which is registered with us
passwd password which is provided by tubelight
audiofile audio file name
msisdn Mobile number
For Example :
Request :-
              {
   "request":    {    "call_start_time":"",    "call_end_time":"",    "retry_unit":,    "retry_gap":,    "username":,    "passwd":,    "audiofile":,    "msisdn":””    } }
Response :-
              { 
                "posts": "call originated" 
              }              
            

Send call-obd-blast Parameters

Base URL: http://tubelight.cloud/voiceapi/single-obd-blast.php

Where Mandatory Parameters are:

Parameter Name Description
call_start_time call start time
call_end_time call last send time
campaing_name Campaing name
retry_unit number of retry unit
retry_gap time period gap between retry
username User name which is registered with us
passwd password which is provided by tubelight
audiofile audio file name
msisdn Multiple Mobile numbers
For Example :
Request :-
              {
   "request":    {    "call_start_time":"",    "call_end_time":"",    "campaing_name":,    "audiofile":,    "retry_unit":,    "retry_gap":,    "username":,    "passwd":,    "msisdn":[{       xxxxxxxxxx,       xxxxxxxxxx,       xxxxxxxxxx,       xxxxxxxxxx,       xxxxxxxxxx       }]    } }
Response :-
              { 
                Return campaign_id
              }              
            

Send call-cdr-obd Parameters

Base URL: http://tubelight.cloud/voiceapi/call-cdr-obd.php

Where Mandatory Parameters are:

Parameter Name Description
username User name which is registered with us
uasswd password which is provided by tubelight
campaign_id which is provided by tubelight when customer submit the obd request
For Example:
Request :-
              {
   "request":    {    "username":,    "passwd":,    "campaign_id":    } }
Response :-
              { 
                CDR data shown
              }              
            

Send call-cdr-ivr Parameters

Base URL: http://tubelight.cloud/voiceapi/call-cdr-ivr.php

Where Mandatory Parameters are:

Parameter Name Description
username User name which is registered with us
uasswd password which is provided by tubelight
service service name like ivr
date date and time
For Example:
Request :-
              {
   "request":    {    "username":,    "passwd":,    "service":,    "date":    } }
Response :-
              { 
                CDR data shown
              }              
            

Send call-cdr-misscall Parameters

Base URL: http://tubelight.cloud/voiceapi/call-cdr-miss-call.php

Where Mandatory Parameters are:

Parameter Name Description
username User name which is registered with us
uasswd password which is provided by tubelight
service service name like misscall
date date and time
For Example:
Request :-
              {
   "request":    {    "username":,    "passwd":,    "service":,    "date":    } }
Response :-
              { 
                CDR data shown
              }              
            

Send call-click-2-call Parameters

Base URL: http://tubelight.cloud/voiceapi/call-click-2-call.php

Where Mandatory Parameters are:

Parameter Name Description
username User name which is registered with us
uasswd password which is provided by tubelight
msisdn-caller Caller Mobile number (agent)
msisdn-calling customer mobile number
For Example:
Request :-
              {
   "request":    {    "username":,    "passwd":,    "msisdn-caller":,    "msisdn-calling":    } }
Response :-
              { 
                Call patched successfully !
              }              
            

Let,s create something great together.