Secure, Scalable & Powerful BulkSMS API Integration

Easy Integrate any application and start sending SMS in minutes. Access sample code in Asp.NET, PHP, Java, C# Many More.

As long as your application is connected to the internet, you can send SMS from it. There are full code examples in every modern language to get you started – and what you do from there is up to you. The possibilities really are endless and our technical support team are on hand to provide you with assistance every step of the way.

Reliably and securely send SMS & receive SMS from any application. Our operator connectivity and intelligent SMS gateway routing assure best-in-class delivery rates and speed.our powerful SMS APIs go beyond plain send/receive and allow you to fetch delivery receipts, schedule messages, pull results from mobile forms & surveys, and more.

SMS Gateway API for any Applications:

 Fast Integration

 Easy to Develop

 Schedule SMS API

 LifeTime Validity

 API Integration Code Libraries

Just choose your preferred language to get started:

 PHP Script

<!DOCTYPE html>
<html>
<head>
<title>SMSpacttown</title>
<link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css”>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js”></script>
<script src=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js”></script>
</head>
<?php
if(isset($_POST[‘submit1’])){
$user = $_POST[‘user’];
$senderid = $_POST[‘senderid’];
$channel = $_POST[‘channel’];
$DCS = $_POST[‘DCS’];
$flashsms = $_POST[‘flashsms’];
$number = $_POST[‘number’];
$message = $_POST[‘message’];
$route = $_POST[‘route’];
$ch=curl_init(‘http://bulksms.pacttown.com/api/mt/SendSMS?APIKEY=’.$user.’&senderid=’.$senderid.’&channel=’.$channel.’&D
CS=’.$DCS.’&flashsms=’.$flashsms.’&number=’.$number.’&text=’.$message.’&route=’.$route.”);
$data = curl_exec($ch);
print($data); /* result of API call*/
}
?>
<body>
<div class=”container”>
<h2>Send Message Using APIKEY</h2>
<form method=”post” action=””>
<div class=”form-group”>
<label for=”api”>API:</label>
<input type=”text” id=”TextBox1″ name=”” value=”http://bulksms.pacttown.com/api/mt/SendSMS?” readonly=”readonly” class=”formcontrol”>
</div>
<div class=”col-md-6″>
<div class=”form-group”>
<label for=”apikey”>APIKey:</label>
<input id=”TextBox2″ type=”text” name=”user” value=”” class=”form-control” placeholder=”Enter APIKey”>
</div>
<div class=”form-group”>
<label for=”senderid”>Sender ID</label>
<input id=”TextBox3″ type=”text” name=”senderid” value=”WEBSMS” class=”form-control”>
</div>
<div class=”form-group”>
<label for=”channel”> Channel</label>
<input id=”TextBox4″ type=”text” name=”channel” value=”” class=”form-control” placeholder=”Enter Channel(Promo/Trans)”>
</div>
<div class=”form-group”>
<label for=”route”>Route:</label>
<input id=”TextBox9″ type=”text” name=”route” value=”1″ class=”form-control”>
</div>
</div>
<div class=”col-md-6″>
<div class=”form-group”>
<label for=”dcs”>DCS</label>
<input id=”TextBox5″ type=”text” name=”DCS” value=”0″ class=”form-control”>
</div>
<div class=”form-group”>
<label for=”flashsms”>FlashSMS</label>
<input id=”TextBox6″ type=”text” name=”flashsms” value=”0″ class=”form-control”>
</div>
<div class=”form-group”>
<label for=”mobnumber”>MobileNo:</label>
<input id=”TextBox7″ type=”text” name=”number” value=”” class=”form-control” placeholder=”Enter MobileNo”>
</div>
<input id=”TextBox8″ type=”text” name=”message” value=”” class=”form-control” placeholder=”Enter Message”>
</div>

<div class=”form-group”>
<label for=”msg”>Message:</label>
<input id=”TextBox8″ type=”text” name=”message” value=”” class=”form-control” placeholder=”Enter Message”>
</div>
</div>
<input type=”submit” name=”submit1″ value=”submit” class=”btn btn-default”>
</form>
</div>
</body>
</html>

 Java Script

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.*;
public class sendsmsApi
{
public static String retval = “”;
public static String SMSSender(String APIKey, String number, String text, String senderid,String channel ,String flashsms,String
route)

{
String rsp = “”;
try {
// Construct The Post Data
String data = URLEncoder.encode(“APIKey”, “UTF-8”) + “=” + URLEncoder.encode(APIKey, “UTF-8”);
data += “&” + URLEncoder.encode(“senderid”, “UTF-8”) + “=” + URLEncoder.encode(senderid, “UTF-8”);
data += “&” + URLEncoder.encode(“channel”, “UTF-8”) + “=” + URLEncoder.encode(channel, “UTF-8”);
data += “&” + URLEncoder.encode(“DCS”, “UTF-8”) + “=” + URLEncoder.encode(“0”, “UTF-8”);
data += “&” + URLEncoder.encode(“flashsms”, “UTF-8”) + “=” + URLEncoder.encode(flashsms, “UTF-8”);
data += “&” + URLEncoder.encode(“number”, “UTF-8”) + “=” + URLEncoder.encode(number, “UTF-8”);
data += “&” + URLEncoder.encode(“text”, “UTF-8”) + “=” + URLEncoder.encode(text, “UTF-8”);
data += “&” + URLEncoder.encode(“route”, “UTF-8”) + “=” + URLEncoder.encode(route, “UTF-8″);
String url1=”http://bulksms.pacttown.com/api/mt/SendSMS”;
url1+=”?”+data;
URL url=new URL(url1);
URLConnection connection = url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
StringBuilder sb = new StringBuilder();
String line;
while ((line = reader.readLine()) != null)
{
sb = sb.append(line);
}
rsp = sb.toString();
}
catch (Exception e)
{
e.printStackTrace();
}
return rsp;
}
public static void main(String[] args) {

String response = SMSSender(“Enter your API key”, “Enter your number”, “Enter test message”, “Enter SenderID”,” Enter Channel”
,”Flash”, “Route”);
System.out.println(“Response”+response);
}
}

 ASP.NET Script

<%Set the values same as you use in your SMSpacttown (bulksms.pacttown.com) account
username = “user”
pwd =”password”
‘Set the mobile number on which you want to send SMS
mobileno = “91XXXXXXXXXX”
‘Your Message
smsg = “Test SMS from SMSpacttown”
‘ You approved sender id
senderid = “#Enter Verified Sender Id”
channel=”# Select Channel” (Trans / Promo)
msg=”testmsg”
routeId=”#Select Route Id that is provided in your sms account”
Dim objXmlHttpMain , sURL
sURL=”http://bulksms.pacttown.com/api/mt/SendSMS user=”&username&”&password=”&&”&senderid=”&senderid&”&channel=”&cha
nnel&”&DCS=0&flashsms=0&number=”&mobileno&”&text=”&msg&”&route=”&routeId&”
Set objXmlHttpMain = Server.CreateObject(“Msxml2.ServerXMLHTTP”)
on error resume next
objXmlHttpMain.open “GET”,sURL, False
objXmlHttpMain.setRequestHeader “Content-Type”, “text/urlencoded”
objXmlHttpMain.send
‘Store response
response.Write (objXmlHttpMain.responseText)
%>

 C# Script

using System
using System.IO
using System.Net
using System.Text
using System.Web
string sAPIKey= “APIKEY”;
string sNumber = Session[“Mobile”].ToString();
string sMessage = “Test SMS From Our Company”;
string sSenderID = “WEBSMS”;
string sChannel=”Select Channel”;
string sRoute=”Select Route”;
string sURL =
“http://bulksms.pacttown.com/api/mt/SendSMS?APIKEY=”+sAPIKey+”&senderid=”+sSenderID+”&channel=”+sChannel+”&DCS=
0&flashsms=0&number=”+sNumber+”&text=”+sMessage+”&route=”+sRoute+”;”
string sResponse = GetResponse(sURL);
Response.Write(sResponse);
public static string GetResponse(string sURL)
{

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sURL);
request.MaximumAutomaticRedirections = 4;
request.Credentials = CredentialCache.DefaultCredentials;
try
{
HttpWebResponse response = (HttpWebResponse)request .GetResponse();
Stream receiveStream = response.GetResponseStream(
);
StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
string sResponse = readStream.ReadToEnd();
response.Close();
readStream.Close();
return sResponse;
}
catch(Exception ex)
{
return ex.tostring();
}
}

HTTP API Integration

HTTP API allows you to integrate your Application to SMS Panel using the HTTP protocol to send SMS.

 HTTP API for Single SMS

http://bulksms.pacttown.com/api/mt/SendSMS?APIKey=YouApiKey&senderid=WEBWEB&channel=Trans/Promo&DCS=0&flashsms=0&number=91989xxxxxxx&text=testmessage&route=##

Response:

{“ErrorCode”:”000″,”ErrorMessage”:”Done”,”JobId”:”20047″,”MessageData”:[{“Number”:”91989xxxxxxx”,”MessageId”:”mvHdpSyS7UOs9hjxixQLvw”},{“Number”:”91846xxxxxxx”,”MessageId”:”PfivClgH20iG6G5R3usHwA”}]}

 HTTP API for Multiple SMS

http://bulksms.pacttown.com/api/mt/SendSMS?APIKey=YouApiKey&senderid=WEBWEB&channel=Promo&DCS=0&flashsms=0&number=91989xxxxxxx,91999xxxxxxx&text=testmessage&route=##

Response:

{“ErrorCode”:”000″,”ErrorMessage”:”Done”,”JobId”:”20047″,”MessageData”:[{“Number”:”91989xxxxxxx”,”MessageId”:”mvHdpSyS7UOs9hjxixQLvw”},{“Number”:”91846xxxxxxx”,”MessageId”:”PfivClgH20iG6G5R3usHwA”}]}

 HTTP API for Schedule SMS

http://bulksms.pacttown.com/api/mt/SendSMS?APIKey=YouApiKey&senderid=WEBSMS&channel=Promo&DCS=0&flashsms=0&number=91989
xxxxxxx&text=testmessage&schedtime=2015/12/31 22:35:00 PM&route=##

Response:
{“ErrorCode”:”000″,”ErrorMessage”:”Done”,”JobId”:”20047″,”MessageData[{“Number”:”91989xxxxxxx”,”MessageId”:”BqTiw66A2UGLFV3DnwHFLQ”}]}

 HTTP API for Group SMS

http://bulksms.pacttown.com/api/mt/SendSMS?APIKey=YouApiKey&senderid=WEBSMS&channel=Promo&DCS=0&flashsms=0&number
=91989xxxxxxx&text=test message&groupid=###&route=##
Response:
{“ErrorCode”:”000″,”ErrorMessage”:”Done”,”JobId”:”20047″,”MessageData[{“Number”:”91989xxxxxxx”,”MessageId”:”mvHdpSyS7UOs9hjxixQLvw”},{“Number”:”91999xxxxxxx”,”MessageId”:”PfivClgH20iG6G5R3usHwA”}]}

 HTTP API for Unicode SMS

http://bulksms.pacttown.com/api/mt/SendSMS?APIKey=YouApiKey&senderid=WEBSMS&channel=Promo&DCS=8&flashsms=0&number=91989xxxxxxx&text=&groupid=###&route=##

Response:

{“ErrorCode”:”000″,”ErrorMessage”:”Done”,”JobId”:”20047″,”MessageData[{“Number”:”91989xxxxxxx”,”MessageId”:”BqTiw66A2UGLFV3DnwHFLQ”}]}

 HTTP API for Check Delivery 

http://bulksms.pacttown.com/api/mt/GetDelivery?APIKey=YouApiKey&jobid=”20047″

Response:

{“ErrorCode”:”0″,”ErrorMessage”:”Done”,”MessageId”:null,”DeliveryReports”:[{“MessageId”:”mvHdpSyS7UOs9hjxixQLvw”,”DeliveryStatus”:”Delivered”,”DeliveryDate”:”2015-09-28T06:17:00″},{“MessageId”:”PfivClgH20iG6G5R3usHwA”,”DeliveryStatus”:”Delivered”,”DeliveryDate”:”2015-09-28T06:17:00″}]}

 HTTP API for Check Balance

http://bulksms.pacttown.com/api/mt/GetBalance?User=demo&Password=demo

Response:

{“ErrorCode”:”0″,”ErrorMessage”:”Done”,”Balance”:”Promo:9988|Trans:0″}

 Parameter Information

Parameter  Name Description
Account Parameters
user Your login username
password Your login password
APIKey Instead of the username and password you can use the apple key for authentication of account
Message Parameters
senderid Approved sender id(6 characters string only).
channel Message channel promotional or transactional
route Pass the route id in this parameter to route the message.
DCS Data coding value (Default is 0 for normal message, Set 8 for unicode sms)
flashsms Flash message immediate display (Default is 0 for normal sms, Set 1 for immediate display)
number Recipient mobile number (pass with comma seprated if need to send on more then one number)
text Your sms content

SMS Marketing Service Made Easy

Trusted by over 10,000+ Clients (Schools, Automobiles, Institutes & Many More)

Get a Free Service Quote Today