google playGoogle Play +91 9406811127 support@msgclub.net Support Pricing

Select Language

		
  1. <?php
  2. //put the name;
  3. $name = "name";
  4. //put the message;
  5. $message = "test message";
  6. //put the comma separated mobile number;
  7. $mobileNumber= '9999999999';
  8. //put the email id;
  9. $email="abc@gmail.com";
  10. $message="Hi ".$name." we received your request. from number is: ".$mobileNumber." and from email ".$email;
  11. //put the sender id;
  12. $senderId="DEMOOS";
  13. $serverUrl="msg.msgclub.net";
  14. //put the auth key;
  15. $authKey="authkey";
  16. $route="1";
  17. echo sendsmsGET($mobileNumber,$senderId,$route,$message,$serverUrl,$authKey);
  18. function sendsmsGET($mobileNumber,$senderId,$routeId,$message,$serverUrl,$authKey)
  19. {
  20. $route = "default";
  21. $getData = 'mobileNos='.$mobileNumber.'&message='.urlencode($message).'&senderId='.$senderId.'&routeId='.$routeId;
  22. //API URL
  23. $url="http://".$serverUrl."/rest/services/sendSMS/sendGroupSms?AUTH_KEY=".$authKey."&".$getData;
  24. // init the resource
  25. $ch = curl_init();
  26. curl_setopt_array($ch, array(
  27. CURLOPT_URL => $url,
  28. CURLOPT_RETURNTRANSFER => true,
  29. CURLOPT_SSL_VERIFYHOST => 0,
  30. CURLOPT_SSL_VERIFYPEER => 0
  31. ));
  32. //get response
  33. $output = curl_exec($ch);
  34. //Print error if any
  35. if(curl_errno($ch))
  36. {
  37. echo 'error:' . curl_error($ch);
  38. }
  39. curl_close($ch);
  40. return $output;
  41. }
  42. <?>

Personilized Send Sms API Code

		
  1. <?php
  2. $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");
  3. $authKey = "yourauthkey";
  4. $ch = curl_init('http://167.114.117.218/rest/services/sendSMS/sendCustomGroupSms?AUTH_KEY='.$authKey);
  5. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  6. curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  8. curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  9. 'Content-Type: application/json',
  10. 'Content-Length: ' . strlen($data_string))
  11. );
  12. $result = json_decode(curl_exec($ch));
  13. curl_close($ch);
  14. if(!$result || $result->responseCode!=3001)
  15. echo "Error while sending sms";
  16. else echo "Sms sent successfully";
  17. <?>

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 with Description

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.

Get quick and easy use of API and test

You will get account with some demo credit to test API that help you write applications and interact with MsgClub PHP APIs

I want to write my own PHP code

company

HTTP API

enterprise solutions

XML API

resellers

JSON API

Industries we support

Frequently asked questions

How to send online SMS from my website in PHP?

You just need to hit or call our bulk SMS API on a single click of action button to start SMS marketing from your website.

How to Integrate SMS API in PHP?

Sign up for an account at MsgClub, go to developer tool you will get multiple types of send SMS API on our platform.

How to send OTP SMS using PHP?

Use our send SMS API for sending OTP SMS to your customers with our best OTP route or banking route.

How to send bulk SMS using API in PHP?

Yes, of course, we provide XML and JSON both type of application programming interface for sending SMS in bulk.

Do you provide PHP script for SMS sending?

Yes, we provide a ready script in PHP for your website or software that helps to send SMS for registration/verification.

How to implement SMS gateway in PHP?

MsgClub have sample code of PHP API with all details that helps you to integrate our SMS gateway.

APIs we provide

PHP SMS Gateway API SMS Gateway API for C# SMS Gateway API JAVA SMS Gateway API for VB.net SMS Gateway API for VB 6.0 SMS Gateway API  for ASP SMS Gateway API for ASP.net

APIs other than Send SMS

SCHEDULE SMS

Send Schedule SMS

Delete Scheduled SMS

Reschedule SMS

GROUP / PHONEBOOK

Add Group

Delete Group

List Group

GROUP CONTACTS

Add Contact

Edit Contact

List Contact

SMS DRAFT

Add Draft

Delete Draft

List Draft

CLIENT (USER / RESELLER)

Add Client

Edit Client

Delete Client

Client List

Disable / Enable

Forgot Password

Transaction Log

Client Balance

Fund Transfer