<?php // set variables $key="YOUR-ACCOUNT-KEY"; $sender="YOUR-SENDER-NAME"; $phone="PHONE-NUMBER"; $message=str_replace(" ","|_","Your OTP is XXXXXX"); $siscb="1"; $arrContextOptions=array( "ssl"=>array( "verify_peer"=>false , "verify_peer_name"=>false , ), ); file_get_contents("https://api.textng.xyz/dnd-free-route-sms/?key=$key&sender=$sender&phone=$phone&message=$message&siscb=$siscb",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"; $siscb="1"; $bypasscode="YOUR-BYPASS-CODE-API"; // Get cURL resource $curl =curl_init (); // Set some options - we are passing in a useragent too herecurl_setopt_array ($curl, [ CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'https://api.textng.xyz/dnd-free-route-sms/?key=$key&sender=$sender&phone=$phone&message=$message&siscb=$siscb', CURLOPT_USERAGENT =>'TEXTNG' ]); // Send the request & save response to $resp $resp = curl_exec($curl); // Close request to clear up some resources curl_close($curl); ?>
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. |
phone |
070001000 | The recipients phone number. |
message |
Your OTP is XXXXXX | The content of the messsage. |
custom_ref | YOUR TRACE ID | 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)