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 Tools Create Sub-Account Check DND Status Check Service Status 3rd-party integrations ZOHO
Promotional SMS Send Promotional text messages (Large campaign transactions) 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 10 minutes.
GET
https://api.textng.xyz/sendsms/?key=YOUR-ACCOUNT-KEY&sender=YOUR-SENDER-NAME&phone=PHONE-NUMBER&message=TEXT-MESSAGE
The GET bulk usage service allows you to send to maximum of 100 Phone Numbers per transaction through the API.
PHP code
<?php
  // Your variables
  $key = 'YOUR-ACCOUNT-KEY';
  $sender = 'exco';
  $phone = '+2349037238073';
  $message = str_replace(" ","|_","Hello world!");
  $arrContextOptions=array(
      "ssl"=>array(
      "verify_peer"=>false,
      "verify_peer_name"=>false,
      ),
  );
  file_get_contents("https://api.textng.xyz/sendsms/?key=$key&sender=$sender&phone=$phone&message=$message", false, stream_context_create($arrContextOptions));
?>
cURL code
<?php
  // Your variables
  $key="YOUR-ACCOUNT-KEY";
  $sender="YOUR-SENDER-NAME";
  $phone="PHONE-NUMBER";
  $message=str_replace(" ","|_","Hello world!"); //the str_replace() function is to replace the spacing in the text with '|_' to enable file_get_contents() function process the url
              
  // Get cURL resource
  $curl = curl_init();
  // Set some options - we are passing in a useragent too here
  curl_setopt_array($curl, [
      CURLOPT_RETURNTRANSFER => 1,
      CURLOPT_URL => 'https://api.textng.xyz/sendsms/?key=$key&sender=$sender&phone=$phone&message=$message',
      CURLOPT_USERAGENT => 'TEXTNG'
  ]);
  // Send the request & save response to $resp
  $resp = curl_exec($curl);
  // Close request to clear up some resources
  curl_close($curl);
?>


POST
https://api.textng.xyz/pushsms/
The POST bulk usage service allows you to send to maximum of 100,000 Phone Numbers per transaction through the API. Seperate each number with a comma(,) in the phone parameter.
PHP code
  // Your variables
  $key="YOUR-ACCOUNT-KEY";
  $sender="YOUR-SENDER-NAME";
  $phone="PHONE-NUMBER";
  // $phone="PHONE-NUMBER1,PHONE-NUMBER2,PHONE-NUMBER3"; //for bulk usage
  $route="MESSAGE-ROUTE";
  $message="Hello world!";

  $response = httpPost("https://api.textng.xyz/pushsms/",array("key"=>"$key","phone"=>"$phone","message"=>"$message","route"=>"$route","sender"=>"$sender"));

  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 * XXXX-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.
Type 0 / 1 / 2 / 6 This specifies the type of message you want to send. Valid types are:
0: Plain Text
1: Flash Plain Text
2: Unicode SMS
6: Unicode Flash SMS

Note: 70 characters makes a page of 1 page Unicode SMS, while 63 characters makes a page for multiple pages Unicode SMS
Schedule YYYY-MM-DD HH:MM eg 2018-01-01 08:10 (24 hour format) Schedule messages to be sent later.
Route 2 / 3 / 4 / 5 / 6 / 7 This specifies the message route you want to send through
2: To Excluded all numbers on DND and Partial DND Numbers. Sends to only NON-DND numbers. This option removes the DND numbers from the list. It's delivers to all NON-DND numbers using a registered sendername.

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.

4: Corporate Route + Bypass Route. This option combines Bypass Route & Corporate Route. It delivers to all NON-DND, DND and Partial DND numbers using a registered sendername. Then uses the bypass route where the sendername fails to deliver.

5: Bypass Route only, runs bypass code only on all numbers. It's delivers to all numbers using the bypass code as sender.

6: Normal Route, runs bypass code only on DND & Partial DND numbers. It's delivers to all NON-DND numbers using a registered sendername and uses the bypass code route to deliver to DND and Partial DND numbers.

7: International Route, pushes all numbers via the bypass code to international numbers. This feature has to be enabled on your account. see Routes & Preferences

bypasscode 070001000 (OPTIONAL) Your unique virtual number hosted to send messages for you. The code can be found at Bypass Code Server. under API code
phone * 070001000 The recipients phone number.
message * Hello there 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.
siscb 0 / 1 This specifies if you want our system to automatically inscribe your sender name to the body of the message to send. Valid values are:
0: YES
1: NO
Responses
Your transaction response will appear in PLAIN TEXT format as shown below.
Successful
// Single number
x units used|| Status:Successful|| Route:6/5/2|| Type:single number|| Reference:##########
// Multiple numbers
x units used|| Status:Successful|| Route:6/5/2|| Type:Multiple numbers(x)|| Reference:########## || CustomRef:###############
Error - Invalid key
Error Invalid Key
Error - Insufficient units
Error Insufficient units
Other Errors
ERROR (the error description would be displayed here)