- <?php
- //put the name;
- $name = "name";
- //put the message;
- $message = "test message";
- //put the comma separated mobile number;
- $mobileNumber= '9999999999';
- //put the email id;
- $email="abc@gmail.com";
- $message="Hi ".$name." we received your request. from number is: ".$mobileNumber." and from email ".$email;
- //put the sender id;
- $senderId="DEMOOS";
- $serverUrl="msg.msgclub.net";
- //put the auth key;
- $authKey="authkey";
- $route="1";
- echo sendsmsGET($mobileNumber,$senderId,$route,$message,$serverUrl,$authKey);
- function sendsmsGET($mobileNumber,$senderId,$routeId,$message,$serverUrl,$authKey)
- {
- $route = "default";
- $getData = 'mobileNos='.$mobileNumber.'&message='.urlencode($message).'&senderId='.$senderId.'&routeId='.$routeId;
- //API URL
- $url="https://".$serverUrl."/rest/services/sendSMS/sendGroupSms?AUTH_KEY=".$authKey."&".$getData;
- // init the resource
- $ch = curl_init();
- curl_setopt_array($ch, array(
- CURLOPT_URL => $url,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_SSL_VERIFYHOST => 0,
- CURLOPT_SSL_VERIFYPEER => 0
- ));
- //get response
- $output = curl_exec($ch);
- //Print error if any
- if(curl_errno($ch))
- {
- echo 'error:' . curl_error($ch);
- }
- curl_close($ch);
- return $output;
- }
- <?>
- <?php
- $payload = array("routeId"=>1,"sentSmsNumList"=>array(array("mobileNumber"=>"8888888888","isAdvanceSms"=>"Hello"),array("mobileNumber"=>"9999999999","isAdvanceSms"=>"hello ankit"),array("mobileNumber"=>"7777777777","isAdvanceSms"=>"hello ritesh")),"senderId"=>"msgclb","signature"=>"signature","smsContentType"=>"english");
- $authKey = "yourauthkey";
- $ch = curl_init('https://167.114.117.218/rest/services/sendSMS/sendCustomGroupSms?AUTH_KEY='.$authKey);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen($data_string))
- );
- $result = json_decode(curl_exec($ch));
- curl_close($ch);
- if(!$result || $result->responseCode!=3001)
- echo "Error while sending sms";
- else echo "Sms sent successfully";
- <?>
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 PHP APIs
You just need to hit or call our API on a single click of action button to start marketing from your website.
Sign up for an account at MsgClub, go to developer tool you will get multiple types of send SMS API on our platform.
Use our send SMS API for sending OTP SMS to your customers with our best OTP route or banking route.
Yes, of course, we provide XML and JSON both type of application programming interface for sending SMS in bulk.
Yes, we provide a ready script in PHP for your website or software that helps to send SMS for registration/verification.
MsgClub have sample code of PHP API with all details that helps you to integrate our SMS gateway.
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