<?php $key="YOUR-ACCOUNT-KEY"; $phone="080XXXXXXXX"; $message_opt_code="XXXX"; $otp_repeat="2"; $custom_ref="REFERENCE-ID"; $response = httpPost("https://api.textng.xyz/voice-otp/" ,array("key"=>"$key","phone"=>"$phone","message-opt-code"=>"$message_opt_code","otp-repeat"=>"$otp_repeat","custom_ref"=>"$custom_ref")); // 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; } ?>
Parameters | Example | Description |
---|---|---|
Key |
XXXXX-XXXX-XXXXX | This can be found in the Developers page of your dashboard. The key authorizes the transaction. |
Phone |
080xxxxxxxxx | This is the phone number you are sending the voice otp to. Only one number per transaction is allowed |
Message-content | Your OTP is XXXXXX | This is the OTP to be sent to the phone. |
OTP-Repeat | 1 / 2 | This is the number of times you want the OTP Code to read out to the customer when the phone is called. |
custom_ref | This is the tracking / tracing code parameter sent to us and used to track each transaction you pushed |
{
"status":"Successful ",
"units_used":"4",
"type":"single number",
"otp-repeated":"2times",
"reference":"XXXXXXXXXXXXXXXXXX",
"custom_ref":"XXXXXXXXXXXXXXXXXXXXXXXXX",
"route":"VOICE-OTP"
}
{
"status":"ERROR ",
"comment":"ERROR WILL BE DISPLAYED HERE"
}