Search
 
SCRIPT & CODE EXAMPLE
 

PHP

termii curl otp

$curl = curl_init();
$data = array( "api_key" => "Your API key",
             "message_type" => "NUMERIC",
             "to" => "eg. 2348109077743",
             "from" => "Aproved Sender or Device IDs",
             "channel" => "dnd",
             "pin_attempts" => 10,
             "pin_time_to_live" =>  5,
             "pin_length" => 6,
             "pin_placeholder" => "< 1234 >",
             "message_text" => "Your pin is < 1234 >",
             "pin_type" => "NUMERIC");

$post_data = json_encode($data);

curl_setopt_array($curl, array(
 CURLOPT_URL => "https://api.ng.termii.com/api/sms/otp/send",
 CURLOPT_RETURNTRANSFER => true,
 CURLOPT_ENCODING => "",
 CURLOPT_MAXREDIRS => 10,
 CURLOPT_TIMEOUT => 0,
 CURLOPT_FOLLOWLOCATION => true,
 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
 CURLOPT_CUSTOMREQUEST => "POST",
 CURLOPT_POSTFIELDS => $post_data,
 CURLOPT_HTTPHEADER => array(
   "Content-Type: application/json"
 ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Comment

PREVIOUS NEXT
Code Example
Php :: Laravel Http client retry request if fail 
Php :: como leer archivos .env php 
Php :: check file extension in php 
Php :: php map array key to variable names 
Php :: laravel collection modelKeys 
Php :: Remove default product data tabs 
Php :: php count result query 
Php :: filter using meta_query 
Php :: laravel - How to concatenate URL and retrieve images from database in json format 
Php :: How to display limited post content in WordPress 
Php :: Downward half-Pyramid Pattern of Star 
Php :: php hook function 
Php :: php variable array for json encode data 
Php :: wordpress not logging when using ngrok 
Php :: child data retrive without timestamp laravel 
Php :: custom middleware laravel 8 
Php :: yajra add column 
Php :: php: foreach loop 
Php :: php mailer 
Php :: php trait 
Php :: what should write for getting extension of image in php 
Php :: store a variable in session and echo that variable on a page wordpress 
Php :: how to convert youtube video to mp3 in php 
Php :: User::factory()-create( 
Php :: laravel edit 
Java :: java enum get nex 
Java :: how java programm actually run 
Java :: java integer to binary string with leading zeros 
Java :: creating random color in java 
Java :: java selenium new empty tab 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =