<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Sms_Controller extends CI_Controller {

        public function __construct() {
        parent::__construct();
        
  
 }
        
         function index(){
                
                //make sure 1 sec sleep any concurrent sending

$mask = 'NANCE';
$token = '18|nB3BHLGaLaNQuagv88TVyckmNEqXxV8OdlS9jlRz';
$api_link = 'https://sms.smsturbine.com/api/v1/sms/send';
$number = 94703838285;   //Receiver Number
$messsage = "THIS IS YOUR MESSAGE"; //Message

$chk = curl_init();

$body = [
	'mask' => $mask,
	'number' => $number,
	'message' => $messsage,
];

$header = [
	'Accept: application/json',
	'Authorization: Bearer ' . $token
];

curl_setopt($chk, CURLOPT_URL, $api_link);		//API link
curl_setopt($chk, CURLOPT_SSL_VERIFYPEER, 1 );
curl_setopt($chk, CURLOPT_POST, 1);              	//Uing POST method
curl_setopt($chk, CURLOPT_POSTFIELDS, $body);        //Parameters
curl_setopt($chk, CURLOPT_HTTPHEADER, $header);      //Header
curl_setopt($chk, CURLOPT_RETURNTRANSFER, 1 );

$response = curl_exec($chk);

curl_close ($chk);

//you can used echo for show the details
//print $response;
echo $response;
            }
}
?>