Menu
Introduction Getting started SMS Promotional - Large campaigns Transactional - Basic Transactional (Alerts) - Virtual Number Route Transactional (Alerts) - Priority Routing Transactional (OTPs & Alerts) - Special route International route to Nigeria International route to Other Countries SMS DLR SMS DLR Webhooks Voice Voice OTP Voice Broadcasts Voice DLR Units Transfer Units to Sub-Account Transfer Units to Other Account Check Units Balance Sender IDs Register Sender IDs Check Sender ID status Categories Add Customer Remove Customer Virtual Number Inbox webhook Carrier Billing Run USSD Query Run Shortcode Query Query Status Carrier Callback Tools Create Sub-Account Check DND Status Check Service Status 3rd-party integrations ZOHO
Voice OTP The API is used when you want to programatically authenticate your users' phone numbers by send OTPs via a voice call
💡 USAGE There is no limit to how many times you can call the API. Just avoid sending the same code to the same number with 10 minutes.
POST
https://api.textng.xyz/voice-otp/
PHP code
<?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 curl
  function 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
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
Responses
Successful (JSON)
{
    "status":"Successful",
    "units_used":"4",
    "type":"single number",
    "otp-repeated":"2times",
    "reference":"XXXXXXXXXXXXXXXXXX",
    "custom_ref":"XXXXXXXXXXXXXXXXXXXXXXXXX",
    "route":"VOICE-OTP"
}

Error (JSON)
{
    "status":"ERROR",
    "comment":"ERROR WILL BE DISPLAYED HERE"
}