<?php $key="YOUR-ACCOUNT-KEY"; $sender="YOUR-SENDER-NAME"; $phone="PHONE-NUMBER"; $message=str_replace(" ","|_","Your OTP is XXXXXX"); //the str_replace() function is to replace the spacing in the text with '|_' so enable file_get_contents() function process the url $route="5"; $bypasscode="YOUR-BYPASS-CODE-API"; $arrContextOptions=array( "ssl"=>array( "verify_peer"=>false , "verify_peer_name"=>false , ), ); file_get_contents("https://api.textng.xyz/sendsms-priority/?key=$key&sender=$sender&phone=$phone&message=$message&route=$route",false , stream_context_create($arrContextOptions)); ?>
<?php $key = "YOUR-ACCOUNT-KEY"; $sender = "YOUR-SENDER-NAME"; $phone = "PHONE-NUMBER"; $message = str_replace(" ","|_","Your OTP is XXXXXX"); //the str_replace() function is to replace the spacing in the text with '|_' so enable file_get_contents() function process the url $route = "5"; $bypasscode = "YOUR-BYPASS-CODE-API"; // Get cURL resource $curl =(); // Set some options - we are passing in a useragent too here curl_init curl_setopt_array ($curl, [ CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL =>'https://api.textng.xyz/sendsms-priority/?key=$key&sender=$sender&phone=$phone&message=$message&route=$route' , CURLOPT_USERAGENT =>'TEXTNG' ]); // Send the request & save response to $resp $resp = curl_exec($curl); // Close request to clear up some resources curl_close($curl); ?>
<?php $key="YOUR-ACCOUNT-KEY"; $sender="YOUR-SENDER-NAME"; $phone="PHONE-NUMBER"; $message=str_replace(" ","|_","Your OTP is XXXXXX"); //the str_replace() function is to replace the spacing in the text with '|_' so enable file_get_contents() function process the url $route="5"; $bypasscode="YOUR-BYPASS-CODE-API"; $response = httpPost("https://api.textng.xyz/pushsms-priority/" ,array("key"=>"$key","sender"=>"$sender","phone"=>"$phone","message"=>"$message","route"=>"$route")); // using php curlfunction httpPost($url, $data){ $curl =curl_init ($url);curl_setopt ($curl, CURLOPT_POST, true);curl_setopt ($curl, CURLOPT_POSTFIELDS, http_build_query($data));curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); curl_close($curl);echo $response; } ?>
Parameter | Example | Description |
---|---|---|
Key |
XXXXX-XXXX-XXXXX | This can be found in the Developers page of your dashboard. The key authorizes the transaction. |
Sender |
TEXTNGCOMM | The sender same shown to the receiver. |
Route | 3 |
This specifies the message route you want to send through 3: Corporate Route only, runs corporate route only on all numbers. Delivers to DND, Partial DND and NON-DND numbers using Sender Name. It's delivers to all numbers (DND, Partial & Non-DND) using a registered sendername only. |
phone |
070001000 | The recipients phone number. |
message |
Your OTP is XXXXXX | The content of the messsage. |
custom_ref | This is the reference code or ID set from your server side/application side to trace/track the message transaction pushed to us. |
x units used|| Status:Successful || Route:3 || Type:single number|| Reference:##########|| CustomRef:###############
Error Invalid Key
Error Insufficient units
ERROR (the error description would be displayed here)