how to integrate bulk sms api in java application

8
Php Application How to Integrate Bulk SMS API in Java Application ? Bulk SMS

Upload: kapsystem

Post on 30-Dec-2015

117 views

Category:

Documents


8 download

DESCRIPTION

Bulk SMS API allows application developer to integrate on their application and send the sms to all the numbers at one shot without login to their sms panel. Anyone can integrate the Bulk SMS API into their applications, software, website, etc.,\nThrough API we can able to check the Status of the sent messages, Delivery report, and group delivery report. We can able to send the Unicode messaging also.\n \nOnce we integrate the Bulk SMS API in any of the application, the application trigger the HTTP API call with all the parameters when on required. The required parameters like SMS Service URL, User Name, Password, Mobile Number, Message, etc.. As soon as call the HTTP API, the api along with all the parameters will be send to SMS Gateway Server and the bulk SMS Gateway evaluate all the parameters and automatically the message will deliver to the given number without login to the SMS panel itself.\n import java.io.BufferedReader;\n import java.io.InputStreamReader;\n import java.io.OutputStreamWriter;\n import java.net.HttpURLConnection;\n import java.net.URL;\n import java.net.URLEncoder;\n import java.util.Properties;\n public class JavaCode{\n public JavaCode() {\n } \n public static void main( String[] args) throws Exception{\n String postData=\"\";\n String retval = \"\";\n //give all Parameters In String \n String Username =\"username\";\n String Password = \"Password\";\n String MobileNo = \"9xxxxxxxxx\"; \n String Message = \"Test message from java code\";\n String SenderID = \"XXXXXX\"; \n postData = \"username=\" Username \"&password=\" Password \"&to=\" \n MobileNo \"&sender=\" SenderID \"&message=\" Message;\n URL url = new URL(\"http://trans.kapsystem.com/web2sms.php?\");\n HttpURLConnection urlconnection = (HttpURLConnection) url.openConnection();\n urlconnection.setRequestMethod(\"POST\");\n urlconnection.setRequestProperty(\"Content-Type\",\"application/x-www-form- \n urlencoded\");\n urlconnection.setDoOutput(true);\n OutputStreamWriter out = new \n OutputStreamWriter(urlconnection.getOutputStream());\n out.write(postData);\n out.close();\n BufferedReader in = new BufferedReader( new \n InputStreamReader(urlconnection.getInputStream()));\n String decodedString;\n while ((decodedString = in.readLine()) != null) {\n retval = decodedString;\n }\n in.close();\n System.out.println(retval);\n }\n }\n\nFor further assistance mail to [email protected] or call on 91 9738010000\n\nFor About Bulk SMS http://www.kapsystem.com\nFor Free Bulk SMS Demo http://www.kapsystem.com/freedemo1.php - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: How to Integrate Bulk SMS API in Java Application

Php

Application

How to Integrate Bulk SMS API in JavaApplication?

Bulk SMS

Page 2: How to Integrate Bulk SMS API in Java Application

1. Wake Up Early

Bulk SMS API allows application developer to integrate on their application and send the sms to all the numbers at one shot without login to their sms panel. Anyone can integrate the Bulk SMS API into their applications, software, website, etc.,Through API we can able to check the Status of the sent messages, Delivery report, and group delivery report. We can able to send the Unicode messaging also.

How to Integrate Bulk SMS API in Java Application?

Page 3: How to Integrate Bulk SMS API in Java Application

1. Wake Up Early

How to Integrate Bulk SMS API in Java Application?

Once we integrate the Bulk SMS API in any of the application, the application trigger the HTTP API call with all the parameters when on required. The required parameters like SMS Service URL, User Name, Password, Mobile Number, Message, etc.. As soon as call the HTTP API, the api along with all the parameters will be send to SMS Gateway Server and the Bulk SMS Gateway evaluate all the parameters and automatically the message will deliver to the given number without login to the SMS panel itself.

Page 4: How to Integrate Bulk SMS API in Java Application

1. Wake Up Early

How to Integrate Bulk SMS API in Java Application?

import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.util.Properties;

public class JavaCode{

public JavaCode() {

} public static void main( String[] args) throws Exception{ String postData=""; String retval = "";

Page 5: How to Integrate Bulk SMS API in Java Application

1. Wake Up Early

How to Integrate Bulk SMS API in Java Application?

//give all Parameters In String String Username ="username"; String Password = "Password"; String MobileNo = "9xxxxxxxxx"; String Message = "Test message from java code"; String SenderID = "XXXXXX"; postData += "username=" + Username + "&password=" + Password + "&to=" + MobileNo +"&sender=" + SenderID + "&message=" + Message; URL url = new URL("http://trans.kapsystem.com/web2sms.php?"); HttpURLConnection urlconnection = (HttpURLConnection) url.openConnection(); urlconnection.setRequestMethod("POST");

Page 6: How to Integrate Bulk SMS API in Java Application

1. Wake Up Early

How to Integrate Bulk SMS API in Java Application?

urlconnection.setRequestProperty("Content-Type","application/x-www-form-urlencoded"); urlconnection.setDoOutput(true); OutputStreamWriter out = new OutputStreamWriter(urlconnection.getOutputStream()); out.write(postData); out.close(); BufferedReader in = new BufferedReader( new InputStreamReader(urlconnection.getInputStream())); String decodedString; while ((decodedString = in.readLine()) != null) { retval += decodedString; } in.close();

System.out.println(retval); } }

Page 7: How to Integrate Bulk SMS API in Java Application

MESSAGING FEATURES

www.kapsystem.com

ADVANTAGE OF KAPSYSTEM

SERVICE

©2015, KAPSYSTEM ( Bulk SMS Service Provider Company) , Email [email protected]

Page 8: How to Integrate Bulk SMS API in Java Application

TRUSTED CLIENTS

www.kapsystem.com

KAP Computer Solution Pvt. Ltd (Bulk SMS Service Provider Company) HQ: Bangalore (Corporate Office)

Our Presence: Bangalore | Delhi | Mumbai | Hyderabad | Chennai | Coimbatore | Pune | Kolkata | Ahmedabad | Noida

Mobile : +91 97380 10000 | 1 [Sales] | Email : [email protected]: www.kapsystem.com

CONTACT US

©2015, KAPSYSTEM ( Bulk SMS Service Provider Company) , Email [email protected]