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
Transactional SMS (OTPs & Alerts) - Special route Send OTPs only through a Network approved sendername route to your audience across all networks in Nigeria.
💡 USAGE There is no limit to how many times you can call the API. Just avoid sending the exact same message to the same number under the time frame of 10mins.
POST
https://api.textng.xyz/otp-sms/
PHP code
<?php
 // set variables
  $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="3";
  $bypasscode="YOUR-BYPASS-CODE-API";
  
    $response = httpPost("https://api.textng.xyz/otp-sms/",array("key"=>"$key","sender"=>"$sender","phone"=>"$phone","message"=>"$message","route"=>"$route"));

  // 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
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.
Responses
Single SMS (success)
x units used|| Status:Successful|| Route:3 || Type:single number|| Reference:##########|| CustomRef:###############
Error - Invalid key
Error Invalid Key
Error - Insufficient units
Error Insufficient units
Other Errors
ERROR (the error description would be displayed here)