                        
<?php
	// Account details
 $username = 'Your Username';
 $password = 'Your Password';
// Message details
 $senderid = 'XXXXXX';
 $template = 'XXXXXXXXXX';
 $type = 'Message Type';
 $product = 'Product Type';
 $number = '91XXXXXXXXXX';
 $message = 'This is your message';
// API credentials
 $credentials = 'username='. $username . '&password='. $password;
// prepare data for GET request
 $data = '&sender='. $senderid . '&mobile='. $number '&type='. $type '&product='. $product '&template='. $template '&message='. $message;
// make url to post using cURL
 $url = 'http://domain/api/sendsms.php?'. $credentials . $data;
 
// Configure cURL options
 $options = array (CURLOPT_RETURNTRANSFER => true , // return web page
 CURLOPT_HEADER => false , // don't return headers
 CURLOPT_FOLLOWLOCATION => false , // follow redirects
 CURLOPT_ENCODING => "" , // handle compressed
 CURLOPT_USERAGENT => "test" , // who am i
 CURLOPT_AUTOREFERER => true , // set referer on redirect
 CURLOPT_CONNECTTIMEOUT => 120 , // timeout on connect
 CURLOPT_TIMEOUT => 120 , // timeout on response
 CURLOPT_MAXREDIRS => 10 ); // stop after 10 redirects
 
// Send the GET request with cURL
 $ch = curl_init ( $url ); 
 curl_setopt_array ( $ch, $options ) 
 $content = curl_exec ( $ch ); 
 $err = curl_errno ( $ch ); 
 $errmsg = curl_error ( $ch ); 
 $header = curl_getinfo ( $ch ); 
 $httpCode = curl_getinfo ( $ch, CURLINFO_HTTP_CODE ); 
 curl_close ( $ch ); 
 
// Receive response
 $header [ 'errno' ] = $err; 
 $header [ 'errmsg' ] = $errmsg; 
 $header [ 'content' ] = $content; 
echo  $header [ 'content' ]; 
?>