public class SendSms{ public static void main(String[] args) { //Your authentication key String authkey = "yourauthkey"; //Multiple mobiles numbers separated by comma String mobiles = "9999999999"; //Sender ID,While using route4 sender id should be 6 characters long. String senderId = "DEMOOS"; //Your message to send, Add URL encoding here. String message = "Test message"; //define route String route="1"; //Prepare Url URLConnection myURLConnection=null; URL myURL=null; BufferedReader reader=null; //encoding message String encoded_message=URLEncoder.encode(message); //Send SMS API String mainUrl="https://msg.msgclub.net/rest/services/sendSMS/sendGroupSms?AUTH_KEY=yourauthkey&message=message&senderId=DEMOOS&routeId=1&mobileNos=9999999999&smsContentType=english"; //Prepare parameter string StringBuilder sbPostData= new StringBuilder(mainUrl); sbPostData.append("authkey="+authkey); sbPostData.append("&mobiles="+mobiles); sbPostData.append("&message="+encoded_message); sbPostData.append("&route="+route); sbPostData.append("&sender="+senderId); //final string mainUrl = sbPostData.toString(); try { //prepare connection myURL = new URL(mainUrl); myURLConnection = myURL.openConnection(); myURLConnection.connect(); reader= new BufferedReader(new InputStreamReader(myURLConnection.getInputStream())); //reading response String response; while ((response = reader.readLine()) != null) //print response System.out.println(response); //finally close connection reader.close(); } catch (IOException e) { e.printStackTrace(); }
Caution: Some users opt to place their request inside a code loop, while testing we highly recommend setting the test parameter to true , as occasionally an infinite loop can occur and users can consume all their credits very quickly.
Parameter Name | Data Type | Description |
---|---|---|
AUTH_KEY * | Alphanumeric | Login Authentication Key(This key is unique for every user) |
message * | Text | Enter your message |
senderId * | Text | Enter senderId it should be less then 6 character |
routeId * | Integer | Which route you want use for sending sms enter routeId for particular route.use given Id for route. Transactional Route=1, Promotinal=2, Promotional SenderId=3 |
mobileNos * | Integer | Mobile number can be entered with country code or without country code Multiple mobile no. should be separated by comma |
groupId * | Integer | To send sms to particular group enter group name created in MsgClub phone book. |
smsContentType* | Text | "English" for text sms and "Unicode" for Unicode sms |
Parameters with (*) are mandatory.
You will get account with some demo credit to test API that help you write applications and interact with MsgClub Java APIs
We have two types of Java API; XML and JSON for sending SMS in bulk to your prospects from our gateway.
Login to our panel, go to developer tool and get different kinds of send SMS API for your own website.
Deploy our send SMS API for sending OTP messages from powerful OTP route and banking route.
AAll you need to just call our bulk SMS API on click of action, our server will generate response on that particular request.
Our developers provides you ready code in PHP with all the necessary details that helps you in integration.
We provide you a ready-made script for sending text messages. This sample scripts are very free and easy to download.
Send Schedule SMS
Delete Scheduled SMS
Reschedule SMS
Add Group
Delete Group
List Group
Add Contact
Edit Contact
List Contact
Add Draft
Delete Draft
List Draft
Add Client
Edit Client
Delete Client
Client List
Disable / Enable
Forgot Password
Transaction Log
Client Balance
Fund Transfer