How to integrate bulk message API with key using php

API is the HTTP to SMS API. This is a Restful API that uses simple query parameters via URLs, however, we encourage our clients to use POST requests when submitting a request to our server. Using a POST request the data will be secure inside the body of the POST request and not appended as URL parameters.

// get the value of variable from input box
$ch = curl_init();
// pass the variable vale in variable
$senderID="TEST SMS";
curl_setopt($ch,CURLOPT_URL, "API KEY");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "user="User api key");
$buffer = curl_exec($ch);
if(empty ($buffer)) {
echo " buffer is empty ";
echo $buffer;
echo "Message Send";

// html code

<form action="" method="post"></form><label for="fname">Mobile Number</label>
<input name="mob" type="text" placeholder="Your name.." />
<label for="subject">Message</label>
<textarea name="message" placeholder="Write the message ."></textarea>

<input name="submit" type="submit" value="Submit" />
Social Share

Leave a Comment