Sei sulla pagina 1di 7

BULK HTTP API DOCUMENTATION

Version 1.4
Sending Message Via HTTP API

HTTP API DOCUMENT V1.4

INTRODUCTION

This HTTP API document will help you use the push platform to send SMS messages through
Query String over HTTP/HTTPS.
The HTTP API can be used to send various types of SMS messages including normal text
messages, flash messages, unicode messages, etc.
The delivery reports and credit balances can be checked using various parameters mentioned in
this document.
All the required parameters and links to the URL along with illustrations are given below.

Copyright 2012. All Rights Reserved

HTTP API DOCUMENT V1.4

SENDING MESSAGES Parameters


Parameter Name Parameter Description

Sample Value

sendsms.php

This is the path to the URl.

http://<domainname>/sendsms.php

username

Username of the account.

&username=test

password

Password of the account

&password=pass123

sender

Sender-Id or the From Id

&sender= Default

mobile

Destination mobile numberCan have 10 digits.

&mobile=99xxxxxxxx

message

Message to be sent

&message=Test Message

route

Value must be 'T' for


Transactional Route

&route=T (sample for transactional


SMS)

SENDING MESSAGES - Examples:


Transactional SMS:
Note:

Route=T (Transactional SMS)

For sending Normal Text Message to single number:


http://<domainname>/sendsms.php?username=user&password=pwd&sender=Senderid&mobi
le=99xxxxxxxx &message=test&route=T

For sending a Normal Text Message to multiple numbers:


http://<domainname>/sendsms.php?username=user&password=pwd&sender=Senderid&mobi
le=99xxxxxxxx,99xxxxxxxx&message=test&route=T
Note- Note the comma (',') should be URL encoded.
---------------------------------------------------------X----------------------------------------------------------------

API for Balance Checking:


http://<domainname>/chkbal.php?username=user&password=pwd
Note: Above API shows available balance in all four routes ( Critical, Radical, Premium &
Transactional )

Copyright 2012. All Rights Reserved

HTTP API DOCUMENT V1.4

API for Sender ID:


http://<domainname>/chkid.php?username=user&password=pwd
Sender id separated by comma ","

API for account login authentication:


http://<domainname>/chklogin.php?username=user&password=pwd
if result is 1 then login ok
else login failed

API for Report:


http:// <domainname>/chkrep.php?sno=506103&username=user&password=pwd
Note: Sno= Message push slot ID- Auto generated while submitting SMS slot

Excel Plug-in:
Excel plug-in enables you to send your campaign directly from the excel sheet containing
mobile numbers & Variable data can be fetched from the sheet.

Prerequisites:
1. High Speed internet connection.
2. Latest version of java must be installed on Machine.
3. Excel plug-in is compatible with all version of Microsoft office, MS Office
must be installed on the machine.
4. Winrar must be installed on machine to extract setup file.

Step for Installation:


1.
2.
3.
4.
5.
6.

Download Excel plug-in from download tab from your account.


This is .rar file & needs to extract with winrar installed on your machine.
Close all your opened excel files.
Open folder & click on setup.
Execute complete setup as per instructions & finish the installation
Open excel file & see on the top right tab with name Add-ins
Copyright 2012. All Rights Reserved

HTTP API DOCUMENT V1.4

7. Click on Add-ins, It will ask for your login credentials provided by your
SMS service provider.
8. After login, read instructions given on the same & enjoy sending campaign
directly from your excel sheet.

Method for API Integration for Sending Messages:


DEFINE PARAMETERS USED IN URL
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''
'To what server you need to connect to for submission
'i.e. Dim Server As String = "domain name"
Dim Server As String = ""
'Username that is to be used for submission
'i.e. Dim UserName As String = "user"
Dim UserName As String = ""
' password that is to be used along with username
'i.e. Dim Password As String = "password"
Dim Password As String = ""
'Message content that is to be transmitted
Dim Message As String = " tset"
'Sender name Source of SMS
Dim Sender As String = " SENDER"
'Destinations to which message is to be sent For submitting more
than one
'destination at once destinations should be comma separated Like
'91999000123,91999000124
Dim Destination As String = ""
Dim WebRequest As Net.WebRequest 'object for WebRequest
Dim WebResonse As Net.WebResponse 'object for WebResponse
'''''''CODE COMPLETE TO DEFINE PARAMETER''''''''''''''''
Method-1
stringpost = "username="YOURUSERNAME"&password=" + "YOURPASSWORD&sendername=SENDERNAME" +
"&mobileno=91" + amobile1 + "&message=" + reportmsg;
MyWebRequest myRequest1 = new MyWebRequest("http://domainname.com/sendsms.php?" + stringpost);

Copyright 2012. All Rights Reserved

HTTP API DOCUMENT V1.4


myRequest1.GetResponse();

Method-2
Dim URL As String = "http://domainname.com/sendsms.php?username=user&password=pwd&sender=SENDER&mobile" &
MOBILE & "&message=" & Message & "&route=T"
WebRequest = Net.HttpWebRequest.Create(URL) 'Hit URL Link
WebRequest.Timeout = 25000
Try
WebResonse = WebRequest.GetResponse 'Get Response
Dim reader As IO.StreamReader = New
IO.StreamReader(WebResonse.GetResponseStream)
'Read Response and store in variable
WebResponseString = reader.ReadToEnd()
WebResonse.Close()
Catch ex As Exception
WebResponseString = "Request Timeout" 'If any exception occur.
End Try
End Sub

Method-3
public static void SendSingleSMS(string message, string mobileNo)
{
try
{
// Set as per y API
string username = "888888";
string password = "88888";
string senderid = "USER";
string domian = "domainname.com";
string result = apicall("http://" + domian + "/sendsms.php?username=" + username +"&password=" + password
+ "&senderid=" + senderid + "&number=" + mobileNo + "&message=" + message + "");
if (result == "Message Sent")
{
}

}
catch
{
//x = 0;
}
}

private string apicall(string url)


{
HttpWebRequest httpreq = (HttpWebRequest)WebRequest.Create(url);
try
{

Copyright 2012. All Rights Reserved

HTTP API DOCUMENT V1.4


HttpWebResponse httpres = (HttpWebResponse)httpreq.GetResponse();
StreamReader sr = new StreamReader(httpres.GetResponseStream());

string results = sr.ReadToEnd(); // come from API


sr.Close();
return results;

}
catch (Exception ex)
{
return "0";
}
}

Method-4For PHP
function sendsms($number,$msg)
{
$domain="";//set your domain here
$username="";//set your username here
$password="";//set your password here
$route="";//set your route here
$sender="";//set your sender id here
$url="http://$domain/sendsms.php?username=$username&password=$password&sender=$send
er&mobile=".urlencode($number)."&message=".urlencode($msg)."&route=$route";
$aa=file_get_contents($url);
}
sendsms($number,$message);//pass mobile number and sms content here in variables $number
& $message respectively

Copyright 2012. All Rights Reserved

Potrebbero piacerti anche