API Development Hub


For developers, our documentation will help you integrate our service to your web, desktop or mobile application. Begin your journey to building an awesome communication experience with your customers.

Quick Start




Sending SMS
(Large Campaigns)


Send Promotional text messages (Large campaign transactions) to all your customers across all networks in Nigeria using our API

GET POST

Documentation

Sending OTPs
(Bypass Code Route)


Send OTPs / Transactional SMS / High Priority SMS using your Bypass Code to all your customers across all networks in Nigeria using our API

GET POST

Documentation

Sending OTPs
(Network Based Routing)


Send OTPs / Transactional SMS / Network Based Routing / Business High Priority SMS using your Bypass Code to all your customers across all networks in Nigeria using our API

POST

Documentation

Sending OTPs
(Special Routing)


Send OTPs only through a Network approved sendername route to all your customers across all networks in Nigeria using our API.

POST

Documentation

Sending OTPs
(DND-FREE-ROUTE)


Send OTPs / Transactional SMS / High Priority SMS using your Sendername to all your customers across all networks in Nigeria using our API

GET

Documentation

Fetch Delivery Report


Get the delivery report from our system on every message you push using our API

GET POST

Documentation

Push Delivery Report PayLoad


Setup your call back url to receive delivery report payload on your server for every message you push through the API

PUSH Callback URL

Documentation

Receive Data Callback (2-way Messaging)


Setup your call back url to receive (messages/sms) data from your virtual numbers on our system through the API

PUSH Callback URL

Documentation

Add Customer


Add and categorize the contacts of all your customers using our API

GET

Documentation

Remove Customer


Remove customer contacts from your categories of customers using our API

GET

Documentation

Units Balance


Constantly check your SMS unit balance using our API

GET

Documentation

Run Carrier USSD


Run a USSD transaction on your bypass code hosted on the carrier billing service

POST

Documentation

Run Carrier ShortCode


Run a ShortCode transaction on your bypass code hosted on the carrier billing service

POST

Documentation

Carrier Query Status


Check the status and response of every Carrier transaction / query (USSD & SHORTCODE) you ran on your carrier billing service

POST

Documentation

Demo & API Wrappers


We had some excellent developers put together some simple projects to make your integrations simpler

Php

Explore

3rd-Party Integrations


Third party applications Textng can currently integrate with

Zoho

View Integrations

VOICE OTP


Send OTPs accross to your customers using a simple voice call.

POST

View Integrations

VOICE Calls / RoboCalls


Send voice broadcasts accross to your customers using a simple voice api call.
Text-TO-Speech

POST GET

View Integrations

Service Status


Use our system status page to monitor all our system service status

OPERATIONAL

System Status




Sending SMS / Promotional SMS


The API is used when you want to programatically send SMS to your people/customers. This can be integrated in your application to get the job done. Basically you are required to call GET the give URL.

GET Send SMS Basic Usage
https://api.textng.xyz/sendsms/?key=YOUR-ACCOUNT-KEY&sender=YOUR-SENDER-NAME&phone=PHONE-NUMBER&message=TEXT-MESSAGE
Rate: 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 Send SMS Basic Usage
https://api.textng.xyz/pushsms/
Rate: 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
Fields(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
sender Required "TEXTNGCOMM" This is the sender the message carries when it is sent.
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)" Optional. Set the message to be scheduled for future delivery.
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's 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. Your account must be enables to get this feature working.
bypasscode This is to specify our SMS engine to use your unique bypass code. The code can be found at Bypass Code Server. under API code
phone Required "0800000000 / 2348000000000" This is the receivers phone number. The destination of the SMS
message Required "Hello World" This is the body of the SMS you are sending. The content message it carries to the receiver
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.
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
GET Bulk SMS Usage
https://api.textng.xyz/sendsms/?key=YOUR-ACCOUNT-KEY&sender=YOUR-SENDER-NAME&phone=PHONE-NUMBER-1,PHONE-NUMBER-2,PHONE-NUMBER-3&message=TEXT-MESSAGE
Note: The GET bulk usage serice allows you to send to maximum of 100 Phone Numbers per transaction through the API
Rate: 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 Bulk SMS Usage
https://api.textng.xyz/pushsms/
Note: The POST bulk usage serice 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
Rate: 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 GET Example Code (PHP)
  
  //Using file_get_contents GET
  
  <?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 '|_' so enable file_get_contents process the url
  
  $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));
  ?> 
  
  
  //ALTERNATIVELY using cURL GET
  
  <?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 '|_' so 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);
  ?>
  
  
  //ALTERNATIVELY using cURL POST
  
  <?php
    //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"));

    //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;
    }
  ?>
  
Plain Text Response on successful for single sms
x units used|| Status:Successful|| Route:6/5/2|| Type:single number|| Reference:##########
Plain Text Response on successful for multiple sms
x units used|| Status:Successful|| Route:6/5/2|| Type:Multiple numbers(X)|| Reference:##########|| CustomRef:###############
Plain Text Response on error for Invalid Key
ERROR invalid KEY
Plain Text Response on error for insufficient SMS units
ERROR insufficient units
Plain Text Response on other errors
ERROR (the error description would be displayed here)




Sending OTPs / Instant SMS / Transactional SMS


This API is used when you want to programatically send OTPs / transactional sms (messages that deliver quickly and with speed) to your people/customers. This can be integrated in your application to get the job done. Basically you are required to call GET the give URL.

GET OTP Basic Usage
https://api.textng.xyz/sendsms/?key=YOUR-ACCOUNT-KEY&sender=YOUR-SENDER-NAME&phone=PHONE-NUMBER&message=TEXT-MESSAGE&route=5&bypasscode=YOUR-BYPASS-CODE-API
Rate: 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 OTP Basic Usage
https://api.textng.xyz/pushsms/
Rate: 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
Fields(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
sender Required "TEXTNGCOMM" This is the sender the message carries when it is sent.
type "0" This specifies the type of message you want to send. Valid types are:
0: Plain Text
schedule "YYYY-MM-DD HH:MM eg 2018-01-01 08:10 (24 hour format)" Optional. Set the message to be scheduled for future delivery.
route Required "3 / 4 / 5 / 6 / 7" 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.
4: Corporate Route + Bypass Route. This option combines Bypass Route & Corporate Route. It's 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: (RECOMMENDED) Bypass Route only, runs bypass code only on all numbers. It's delivers to all numbers using the bypass code as sender.
6: (STANDARD) 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. Your account must be enables to get this feature working.
bypasscode Required This is to specify our SMS engine to use your unique bypass code. The code can be found at Bypass Code Server. under API code
phone Required "0800000000 / 2348000000000" This is the receivers phone number. The destination of the SMS
message Required "Your OTP is XXXXXX" This is the body of the SMS you are sending. The content message it carries to the receiver
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.
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
POST GET OTP API Usage
Note: The usage of this serice allows you to send to maximum of 1 phone number per transaction through the API
POST GET Example Code (PHP)
  
  //Using file_get_contents GET
  
  <?php
  //Your 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="5";
  $bypasscode="YOUR-BYPASS-CODE-API";
  
  $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&route=$route&bypasscode=$bypasscode", false, stream_context_create($arrContextOptions));
  ?>
  
  
  //ALTERNATIVELY using cURL GET
  
  <?php
    //Your 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="5";
    $bypasscode="YOUR-BYPASS-CODE-API";
    
    // 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&route=$route&bypasscode=$bypasscode',
        CURLOPT_USERAGENT => 'TEXTNG'
    ]);
    // Send the request & save response to $resp
    $resp = curl_exec($curl);
    // Close request to clear up some resources
    curl_close($curl);
  ?>
  
  
  //ALTERNATIVELY using cURL POST
  
  <?php
    //Your variables
    $key="YOUR-ACCOUNT-KEY";
    $sender="YOUR-SENDER-NAME";
    $phone="PHONE-NUMBER";
    $message="Your OTP is XXXXXX";
    $route="5";
    $bypasscode="YOUR-BYPASS-CODE-API";
  
    $response = httpPost("https://api.textng.xyz/pushsms/",array("key"=>"$key","sender"=>"$sender","phone"=>"$phone","message"=>"$message","route"=>"$route","bypasscode"=>"$bypasscode"));

    //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;
    }
  ?>
  
Plain Text Response on successful for single OTP sms
x units used|| Status:Successful|| Route:6/5/2|| Type:single number|| Reference:##########|| CustomRef:###############
Plain Text Response on error for Invalid Key
ERROR invalid KEY
Plain Text Response on error for insufficient SMS units
ERROR insufficient units
Plain Text Response on other errors
ERROR (the error description would be displayed here)




Sending OTPs / Business Instant SMS / Network Routing


This API is used when you want to programatically send OTPs / transactional sms (messages that deliver quickly and with speed) to your people/customers. This can be integrated in your application to get the job done. Basically you are required to call GET the give URL.

POST OTP Basic Usage
https://api.textng.xyz/pushsms-priority/
Rate: 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
GET OTP Basic Usage
https://api.textng.xyz/sendsms-priority/?key=YOUR-ACCOUNT-KEY&sender=YOUR-SENDER-NAME&phone=PHONE-NUMBER&message=TEXT-MESSAGE&route=5
Rate: 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
Fields(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
sender Required "TEXTNGCOMM" This is the sender the message carries when it is sent.
type "0" This specifies the type of message you want to send. Valid types are:
0: Plain Text
schedule "YYYY-MM-DD HH:MM eg 2018-01-01 08:10 (24 hour format)" Optional. Set the message to be scheduled for future delivery.
route Required "5 / 7" This specifies the message route you want to send through
5: (RECOMMENDED) Bypass Route only, runs bypass code only on all numbers. It's delivers to all numbers using the bypass code as sender.
7: International Route, pushes all numbers via the bypass code to international numbers. Your account must be enables to get this feature working.
phone Required "0800000000 / 2348000000000" This is the receivers phone number. The destination of the SMS
message Required "Your OTP is XXXXXX" This is the body of the SMS you are sending. The content message it carries to the receiver
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.
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
POST API Usage
Note: The usage of this serice allows you to send to maximum of 100,000 phone numbers per transaction through the API
GET API Usage
Note: The usage of this serice allows you to send to maximum of 100 phone numbers per transaction through the API
GET POST Example Code (PHP)
  
  //Using file_get_contents GET
  
  <?php
  //Your 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="5";
  
  $arrContextOptions=array(
        "ssl"=>array(
            "verify_peer"=>false,
            "verify_peer_name"=>false,
        ),
    );
  file_get_contents("https://api.textng.xyz/sendsms-priority/?key=$key&sender=$sender&phone=$phone&message=$message&route=$route", false, stream_context_create($arrContextOptions));
  ?>
  
  
  //ALTERNATIVELY using cURL GET
  
  <?php
    //Your 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="5";
    
    // 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-priority/?key=$key&sender=$sender&phone=$phone&message=$message&route=$route',
        CURLOPT_USERAGENT => 'TEXTNG'
    ]);
    // Send the request & save response to $resp
    $resp = curl_exec($curl);
    // Close request to clear up some resources
    curl_close($curl);
  ?>
  
  
  //using cURL POST
  
  <?php
    //Your variables
    $key="YOUR-ACCOUNT-KEY";
    $sender="YOUR-SENDER-NAME";
    $phone="PHONE-NUMBER";
    $message="Your OTP is XXXXXX";
    $route="5";
  
    $response = httpPost("https://api.textng.xyz/pushsms-priority/",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;
    }
  ?>
  
Plain Text Response on successful for single OTP sms
x units used|| Status:Successful|| Route:5/7 || Type:single number|| Reference:##########|| CustomRef:###############
Plain Text Response on error for Invalid Key
ERROR invalid KEY
Plain Text Response on error for insufficient SMS units
ERROR insufficient units
Plain Text Response on other errors
ERROR (the error description would be displayed here)




Sending OTPs / Special Routing / Network Approved Senders


This API is used when you want to programatically send OTPs / transactional sms (messages that deliver quickly and with speed) to your people/customers using a network approved sender route. This can be integrated in your application to get the job done. Basically you are required to call POST the give URL.

POST OTP Basic Usage
https://api.textng.xyz/otp-sms/
Rate: 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
Fields(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
sender Required "TEXTNGCOMM" This is the brand name the message carries in the body when it is sent.
route Required "3" This specifies the message route you want to send through
3: (RECOMMENDED) Network Approved Route, use this route value for all transactions to this URL endpoint
phone Required "0800000000 / 2348000000000" This is the receivers phone number. The destination of the SMS
message Required "Your OTP is XXXXXX" This is the approved body of the SMS you are sending. The content message it carries to the receiver
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.
POST API Usage
Note: The usage of this serice allows you to send to maximum of 1 phone number per transaction through the API
POST Example Code (PHP)
  
  //using cURL POST
  
  <?php
    //Your variables
    $key="YOUR-ACCOUNT-KEY";
    $sender="YOUR-SENDER-NAME";
    $phone="PHONE-NUMBER";
    $message="Your OTP is XXXXXX";
    $route="3";
  
    $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;
    }
  ?>
  
Plain Text Response on successful for single OTP sms
x units used|| Status:Successful|| Route:3 || Type:single number|| Reference:##########|| CustomRef:###############
Plain Text Response on error for Invalid Key
ERROR invalid KEY
Plain Text Response on error for insufficient SMS units
ERROR insufficient units
Plain Text Response on other errors
ERROR (the error description would be displayed here)




Sending OTPs / Transactional SMS (DND-FREE-ROUTE) using Sendername ONLY


This API is used when you want to programatically send OTPs / transactional sms (messages that deliver quickly and with speed) to your people/customers using Sendername ONLY. This can be integrated in your application to get the job done. Basically you are required to call GET the give URL.

GET DND-FREE-ROUTE Basic Usage
https://api.textng.xyz/dnd-free-route-sms/?key=YOUR-ACCOUNT-KEY&sender=YOUR-REGISTERED-SENDERNAME&phone=080XXXXXXXX&message=MESSAGE&siscb=1
Rate: 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 5mins
Fields(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
Note: Account must have been cleared for using this route before it works.
sender Required "TEXTNGCOMM" This is the Registered sender name the message carries when it is sent.
Note: Sendername must be registered before route can work
phone Required "0800000000" This is the receivers phone number. The destination of the SMS
message Required "Your OTP is XXXXXX" This is the body of the SMS you are sending. The content message it carries to the receiver
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.
siscb Required "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:
1: NO
GET DND-FREE ROUTE API Usage
Note: The usage of this serice allows you to send to maximum of 1 phone number per transaction through the API
GET Example Code (PHP)
  
  //Using file_get_contents GET
  
  <?php
  //Your 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
  $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));
  ?>
  
  
  //ALTERNATIVELY using cURL GET
  
  <?php
    //Your 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
    $siscb="1";
    
    // 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/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);
  ?>
  
Plain Text Response on successful for single DND-FREE ROUTE sms
x units used|| Status:Successful|| Route:3|| Type:single number|| Reference:##########|| CustomRef:###############
Plain Text Response on error for Invalid Key
ERROR invalid KEY
Plain Text Response on error for route clearance
ERROR account not cleared for DND-FREE ROUTE
Plain Text Response on error for insufficient SMS units
ERROR insufficient units
Plain Text Response on other errors
ERROR (the error description would be displayed here)




Fetch Delivery Report


The API is used when you want to programatically get the delivery status on the numbers you've sent messages to. This can be integrated in your application to get the job done. Basically you are required to call GET the give URL.
Note: We advise you to call this API frequently to get the actually status of the numbers as they change. The data would be available to fetch only for 30days after transaction is done.

GET DLR Basic Usage
https://api.textng.xyz/deliveryreport/?key=YOUR-ACCOUNT-KEY&reference=MESSAGE-REFERENCE-NUMBER&req=COMMAND&used_route=MESSAGE-ROUTE
Rate: There is no limit to how many times you can call the API.
POST DLR Basic Usage
https://api.textng.xyz/deliveryreport_post/
Rate: There is no limit to how many times you can call the API.
Field(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
reference Required "xxxxxxxxxx" This is the reference number generated for each sms sent. you'll get this in the DLR page, and it is also displayed when you use the API to send message
req Required "all/ dnd/ success" This specifies the type of numbers you want in the report. Valid types of command are:
all: To get both delivered and blocked(if message was sent via route 2)/sent via bypass route numbers seperated and shown in the report
dnd: To get only the numbers that were blocked(if message was sent via route 2) OR messages sent via bypass route
success: To get only the numbers that were delivered to successfully
used_route Required "2/ 5 / 6" This specifies the message route you used to send the sms you want the report
GET Example Code (PHP)
  
  //Using file_get_contents
  
  <?php
  //Variables
  $key="YOUR-ACCOUNT-KEY";
  $reference="MESSAGE-REFERENCE-NUMBER";
  $req="COMMAND";
  $used_route="MESSAGE-ROUTE";
  
  $arrContextOptions=array(
        "ssl"=>array(
            "verify_peer"=>false,
            "verify_peer_name"=>false,
        ),
    );
    $data = file_get_contents("https://api.textng.xyz/deliveryreport/?key=$key&reference=$reference&req=$req&used_route=$used_route", false, stream_context_create($arrContextOptions));
    $decode = json_decode($data);
    $extracted_data = $decode->D->details;
    foreach ($extracted_data as $extracted_data_info)
    {
        echo $phone_number = $extracted_data_info->number;
        echo $status = $extracted_data_info->status;
        echo $track_id = $extracted_data_info->track_id;
    }
  ?>
  
  
  //ALTERNATIVELY using cURL POST
  
  <?php
    //Your variables
    $key="YOUR-ACCOUNT-KEY";
    $reference="MESSAGE-REFERENCE-NUMBER";
    $req="COMMAND";
    $used_route="MESSAGE-ROUTE";
  
    $response = httpPost("https://api.textng.xyz/deliveryreport_post/",array("key"=>"$key","reference"=>"$reference","req"=>"$req","used_route"=>"$used_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;
        $decode = json_decode($response);
        $extracted_data = $decode->D->details;
        foreach ($extracted_data as $extracted_data_info)
        {
            echo $phone_number = $extracted_data_info->number;
            echo $status = $extracted_data_info->status;
            echo $track_id = $extracted_data_info->track_id;
        }
    }
  ?>
  
JSON Response on successful for DLR
{"D":{"details":[{"number":"234XXXXXXXXX","status":"DELIVERED","track_id":"xxxxxxxxxx"},{"number":"234XXXXXXXXX","status":"DELIVRD","track_id":"xxxxxxxxxx"},{"number":"234XXXXXXXXX","status":"SENT-VIA-BYPASS","track_id":"xxxxxxxxxx"},{"number":"234XXXXXXXXX","status":"SENT-BUT-PENDING","track_id":"xxxxxxxxxx"},{"number":"234XXXXXXXXX","status":"BLOCKED","track_id":"xxxxxxxxxx"}]}}
Plain Text Response on DLR error for Invalid reference number
ERROR invalid REFERENCE NUMBER
Plain Text Response on DLR error for Invalid key
ERROR invalid key
JSON Response on Sub-DLR data Expand error for Invalid ref_id
{"D":{"details":[{"report":"NOT-AVAILABLE"}]}}




Push Delivery Report Payload


Setup a callback url to programatically receive the delivery status on the numbers you've sent messages to on your server. This can be integrated in your application to get the job done. Basically you are required to setup a callback url to receive a JSON data push PUSH

PUSH Setting up Callback URL
To set-up the Callback url, kindly visit the page Account Settings. Under Callback URL section, insert the callback url you wish to receive the dlr.
Usage
Note: Your will receive a callback push payload to your callback URL/endpoint for each message sent via our API
PUSH Example Code (PHP)
  
  //Use the following code below in your callback URL to receive the push payload
  
  //Using file_get_contents
  
  <?php
  
    if (getenv('REQUEST_METHOD') == 'POST') 
    {
        $postData = file_get_contents("php://input");
        if (!empty($postData)) 
        {
            $decode = json_decode($postData);
            $extracted_data = $decode->D->details;
            foreach ($extracted_data as $extracted_data_info)
            {
                echo $phone_number = $extracted_data_info->number;
                echo $status = $extracted_data_info->status;
                echo $track_id = $extracted_data_info->track_id;
                echo $timesent = $extracted_data_info->timesent;
                echo $custom_ref = $extracted_data_info->custom_ref;
            }
        }
    }
  ?>
  
JSON Sample Data pushed for DLR
{"D":{"details":[{"number":"234XXXXXXXXX","status":"DELIVERED","track_id":"xxxxxxxxxx","timesent":"TIME-MESSAGE-WAS-SENT","custom_ref":"xxxxxxxxxx"},{"number":"234XXXXXXXXX","status":"DELIVRD","track_id":"xxxxxxxxxx","timesent":"TIME-MESSAGE-WAS-SENT","custom_ref":"xxxxxxxxxx"},{"number":"234XXXXXXXXX","status":"SENT-VIA-BYPASS","track_id":"xxxxxxxxxx","timesent":"TIME-MESSAGE-WAS-SENT","custom_ref":"xxxxxxxxxx"},{"number":"234XXXXXXXXX","status":"SENT-BUT-PENDING","track_id":"xxxxxxxxxx","timesent":"TIME-MESSAGE-WAS-SENT","custom_ref":"xxxxxxxxxx"},{"number":"234XXXXXXXXX","status":"BLOCKED","track_id":"xxxxxxxxxx","timesent":"TIME-MESSAGE-WAS-SENT","custom_ref":"xxxxxxxxxx"}]}}




Receive Message/SMS Callback Data (2-Way Messaging)


Setup a callback url to programatically receive data(messages/sms) sent to your virtual number(bypass code) on your server. This can be integrated in your application to get the job done. Basically you are required to setup a callback url on your Bypass Code server interface to receive a GET REQUEST data push on your server end.PUSH GET

PUSH GET Setting up Callback URL
To set-up the Callback url, kindly visit the page Bypass Code Engine. Under Bypass Code Engine Section, Click on the "Access Server" button. Under the Push Setting, insert the callback url you wish to receive the data.
PUSH GET Example Code (PHP)
  
  //Use the following code below in your callback URL
  
  <?php
  
    //get the variables set
    $from=$_GET['from']; //this is the phone number / sender of the message
    
    $message=$_GET['message']; //this is the message content sent in the transactions
    
    $timereceived=$_GET['timereceived']; //this is the time the message was sent 
    
    $bypasscode=$_GET['bypasscode']; //this is the virtual number/ bypass code the message was sent to.
    
    //Do what ever you like with the data received here
  ?>
  
URL encoded plain Text Sample Data pushed for DLR
from=080xxxxxxxxxxxx&message=TestMessage&timereceived=TIMERECEIVED&bypasscode=234900000000000000




Create New Customer / Contact


The API is used when you want to programatically create a new customer/recipient/contact under a category. This can be integrated in your application to get the job done. Basically you are required to call GET the give URL.
Note: You'll have to create a category from the category page in your account, then create a contacts url from the customer page in your account.

GETBasic Usage
https://api.textng.xyz/addcustomer/?key=YOUR-ACCOUNT-KEY&catid=CATEGORY-URL-ID&customername=CUSTOMER-FULLNAME&customerphone=CUSTOMER-PHONENUMBER
Rate: There is no limit to how many times you can call the API.
Field(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
catid Required "xxxxxxxxxx" This is the category url ID generated for each url link you create. you'll get this in the Customer URL Upload page
customername Required "Adekunle" This the name you want to save the recipient/customer as
customerphone Required "080XXXXXX" This is the phone number of the recipient/customer to be saved
GET Example Code (PHP)
  
  //Using file_get_contents
  
  <?php
  //Variables
  $key="YOUR-ACCOUNT-KEY";
  $catid="CATEGORY-URL-ID";
  $customername=str_replace(" ","|_","CUSTOMER FULLNAME"); //the str_replace() function is to replace the spacing in the text with '|_' so enable file_get_contents process the url
  $customerphone="CUSTOMER-PHONENUMBER";
  
  $arrContextOptions=array(
        "ssl"=>array(
            "verify_peer"=>false,
            "verify_peer_name"=>false,
        ),
    );
    $data = file_get_contents("https://api.textng.xyz/addcustomer/?key=$key&catid=$catid&customername=$customername&customerphone=$customerphone", false, stream_context_create($arrContextOptions));
    $decode = json_decode($data);
    $extracted_data = $decode->D->details;
    foreach ($extracted_data as $extracted_data_info)
    {
        echo $customer_phone = $extracted_data_info->customerphone;
        echo $customer_name = $extracted_data_info->customername;
        echo $catid = $extracted_data_info->catid;
        echo $status = $extracted_data_info->status;
    }
  ?>
  
JSON Response on successful for creating customer/recipient
{"D":{"details":[{"customerphone":"080xxxxxx","customername":"CUSTOMER-NAME","catid":"xxxxxxxxxx","status":"successful"}]}}
JSON Response on error for customer phone already existing in category
{"D":{"details":[{"customerphone":"080xxxxxx","customername":"CUSTOMER-NAME","catid":"xxxxxxxxxx","status":"error-customerphone-exists-in-category"}]}}
JSON Response on error for missing customer name
{"D":{"details":[{"status":"customername-not-exists"}]}}
JSON Response on error for missing customer phone
{"D":{"details":[{"status":"customerphone-not-exists"}]}}
JSON Response on error for Invalid catid
{"D":{"details":[{"status":"catid-not-exists"}]}}
JSON Response on error for Invalid key
{"D":{"details":[{"status":"key-invalid"}]}}




Remove Customer / Contact


The API is used when you want to programatically delete a customer/recipient/contact under a category. This can be integrated in your application to get the job done. Basically you are required to call GET the give URL.

GETBasic Usage
https://api.textng.xyz/removecustomer/?key=YOUR-ACCOUNT-KEY&catid=CATEGORY-URL-ID&customerphone=CUSTOMER-PHONENUMBER
Rate: There is no limit to how many times you can call the API.
Field(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
catid Required "xxxxxxxxxx" This is the category url ID generated for each url link you create. you'll get this in the Customer URL Upload page
customerphone Required "080XXXXXX" This is the phone number of the recipient/customer to be saved
GET Example Code (PHP)
  
  //Using file_get_contents
  
  <?php
  //Variables
  $key="YOUR-ACCOUNT-KEY";
  $catid="CATEGORY-URL-ID";
  $customerphone="CUSTOMER-PHONENUMBER";
  
  $arrContextOptions=array(
        "ssl"=>array(
            "verify_peer"=>false,
            "verify_peer_name"=>false,
        ),
    );
    $data = file_get_contents("https://api.textng.xyz/removecustomer/?key=$key&catid=$catid&customerphone=$customerphone", false, stream_context_create($arrContextOptions));
    $decode = json_decode($data);
    $extracted_data = $decode->D->details;
    foreach ($extracted_data as $extracted_data_info)
    {
        echo $customer_phone = $extracted_data_info->customerphone;
        echo $catid = $extracted_data_info->catid;
        echo $status = $extracted_data_info->status;
    }
  ?>
  
JSON Response on successful for removing customer
{"D":{"details":[{"customerphone":"080xxxxxx","customername":"CUSTOMER-NAME","catid":"xxxxxxxxxx","status":"successfully-removed"}]}}
JSON Response on error for customer phone does not existing in category
{"D":{"details":[{"customerphone":"080xxxxxx","customername":"CUSTOMER-NAME","catid":"xxxxxxxxxx","status":"error-customerphone-does-not-exists-in-category"}]}}
JSON Response on error for missing customer phone
{"D":{"details":[{"status":"customerphone-not-exists"}]}}
JSON Response on error for Invalid catid
{"D":{"details":[{"status":"catid-not-exists"}]}}
JSON Response on error for Invalid key
{"D":{"details":[{"status":"key-invalid"}]}}




SMS Units Balance


The API is used when you want to programatically check your sms units balance. This can be integrated in your application to get the job done. Basically you are required to call GET the give URL.

GETBasic Usage
https://api.textng.xyz/smsbalance/?key=YOUR-ACCOUNT-KEY&checkbalance=1
Rate: There is no limit to how many times you can call the API.
Field(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
GET Example Code (PHP)
  
  //Using file_get_contents
  
  <?php
  //Variables
  $key="YOUR-ACCOUNT-KEY";
  
  $arrContextOptions=array(
        "ssl"=>array(
            "verify_peer"=>false,
            "verify_peer_name"=>false,
        ),
    );
    $data = file_get_contents("https://api.textng.xyz/smsbalance/?key=$key&checkbalance=1", false, stream_context_create($arrContextOptions));
    $decode = json_decode($data);
    $extracted_data = $decode->D->details;
    foreach ($extracted_data as $extracted_data_info)
    {
        echo $key = $extracted_data_info->key;
        echo $unitsbalance = $extracted_data_info->unitsbalance;
        echo $timechecked = $extracted_data_info->time;
        echo $status = $extracted_data_info->status;
    }
  ?>
  
JSON Response on successful for retrieving SMS Balance
{"D":{"details":[{"key":"XXXXXXXXXXXXXXXXXXXXXXXXXXX","unitsbalance":"XXX","time":"2000-01-01 01:10:15","status":"successful"}]}}
JSON Response on error for Invalid balance code
{"D":{"details":[{"status":"invalid-balance-code"}]}}
JSON Response on error for Invalid key
{"D":{"details":[{"status":"key-invalid"}]}}




Run Carrier USSD Query


The API is used when you want to programatically run a ussd query on your virtual number using the carrier billing service. This can be integrated in your application to get the job done. Basically you are required to call POST the give URL.

POST Basic Usage
https://api.textng.xyz/carrier_ussd/
Rate: There is no limit to how many times you can call the API.
Field(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
bypasscode Required This is to specify our carrier billing engine to use your unique bypass code. The code can be found at Carrier Billing Home under API code
ussd Required "e.g *131# / *123#" This is the ussd query you want to run on the specified bypass code for the carrier billing service
ussd_steps "1,2,3" This is are the other responses you want the USSD query to process when they are requested. e.g some USSD queries may require you to press 1 or 2 in other stages of the USSD sessions.

NOTE: Ensure to Seperate this with commas (,) and arrange in order of how it is to be used in the USSD stages (First Response, Second Response, to Last Response).
amt Required "0" This is the amount of money received if you charged for the service. This is just to help you keep track of cash received if your vending on our service. Leave the value at "0" if you wish to ignore.
pin Required "xxxxxx" This is the push pin used to authorize the query to run on the carrier billing service
POST Example Code (PHP)
  
  //using cURL POST
  
  <?php
    //Your variables
    $key="YOUR-ACCOUNT-KEY";
    $bypasscode="BYPASS CODE SERVER KEY";
    $ussd_query="USSD QUERY";
    $ussd_steps="1,2,4,2";
    $amount="AMOUNT";
    $push_pin="PIN";
  
    $response = httpPost("https://api.textng.xyz/carrier_ussd/",array("key"=>"$key","bypasscode"=>"$bypasscode","ussd"=>"$ussd_query","ussd_steps"=>"$ussd_steps","amt"=>"$amount","pin"=>"$push_pin"));

    //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;
    }
  ?>
  
JSON Response on successful query execution
{"D":{"details":[{"status":"successful","ref_id":"REFERENCE_ID","query":"USSD_QUERY_PUSHED","type":"USSD"}]}}
JSON Response on error for Bypass Code authentication
{"D":{"details":[{"status":"error-bypasscode-expired-or-not-exist"}]}}
JSON Response on error for Incorrect Push Pin
{"D":{"details":[{"status":"error-incorrect-push-pin"}]}}
JSON Response on error for Invalid key
{"D":{"details":[{"status":"error-key-invalid"}]}}




Run Carrier SHORTCODE Request


The API is used when you want to programatically run a shortcode query on your virtual number using the carrier billing service. This can be integrated in your application to get the job done. Basically you are required to call POST the give URL.

POST Basic Usage
https://api.textng.xyz/carrier_shortcode/
Rate: There is no limit to how many times you can call the API.
Field(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
bypasscode Required This is to specify our carrier billing engine to use your unique bypass code. The code can be found at Carrier Billing Home under API code
shortcode Required "131" This is the destination shortcode you want to send a message to on the specified bypass code for the carrier billing service
message Required "2" This is the message you want to send to the shortcode on the specified bypass code for the carrier billing service
amt Required "0" This is the amount of money received if you charged for the service. This is just to help you keep track of cash received if your vending on our service. Leave the value at "0" if you wish to ignore.
pin Required "xxxxxx" This is the push pin used to authorize the query to run on the carrier billing service
POST Example Code (PHP)
  
  //using cURL POST
  
  <?php
    //Your variables
    $key="YOUR-ACCOUNT-KEY";
    $bypasscode="BYPASS CODE SERVER KEY";
    $shortcode="SHORTCODE";
    $message="MESSAGE TO BE SENT";
    $amount="AMOUNT";
    $push_pin="PIN";
  
    $response = httpPost("https://api.textng.xyz/carrier_shortcode/",array("key"=>"$key","bypasscode"=>"$bypasscode","shortcode"=>"$shortcode","message"=>"$message","amt"=>"$amount","pin"=>"$push_pin"));

    //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;
    }
  ?>
  
JSON Response on successful query execution
{"D":{"details":[{"status":"successful","ref_id":"REFERENCE_ID","query":"SHORTCODE_QUERY_PUSHED","type":"SHORTCODE"}]}}
JSON Response on error for Bypass Code authentication
{"D":{"details":[{"status":"error-bypasscode-expired-or-not-exist"}]}}
JSON Response on error for Incorrect Push Pin
{"D":{"details":[{"status":"error-incorrect-push-pin"}]}}
JSON Response on error for Invalid key
{"D":{"details":[{"status":"error-key-invalid"}]}}




Carrier Transaction / Query Status


The API is used when you want to programatically fetch the status of the query / transaction you ran on your virtual number using the carrier billing service. This can be integrated in your application to get the job done. Basically you are required to call POST the give URL.

POST Basic Usage
https://api.textng.xyz/carrier_transaction_status/
Rate: There is no limit to how many times you can call the API.
Field(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
ref_id Required This is the "ref_id" parameter returned on each query / transaction you pushed
POST Example Code (PHP)
  
  //using cURL POST
  
  <?php
    //Your variables
    $key="YOUR-ACCOUNT-KEY";
    $ref_id="REFERENCE-ID";
    
    $response = httpPost("https://api.textng.xyz/carrier_transaction_status/",array("key"=>"$key","ref_id"=>"$ref_id"));

    //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;
    }
  ?>
  
JSON Response on successful
{"D":{"details":[{"status":"QUERY STATUS","ref_id":"XXXXXXXXXXXXXXX","query":"*556#","query_response":"THE RESPONSE FROM THE NETWORK","type":"USSD","bypasscode":"23490XXXXXXXXX","amount_paid":"0"}]}}
JSON Response on error for Invalid key
{"D":{"details":[{"status":"error-key-invalid"}]}}






Explore Demos & API Wrappers




API-Wrapper


A simple API Wrapper that helps you integrate our APIs easily.
--
By Samuel Ogaba (elmage)

GITHUB Php

Explore






3rd-Party Integrations




Zoho CRM


Send text messages to all your customers from your Zoho CRM using our exclusive Zoho API

GET

Documentation




Zoho CRM Integration


The API is used when you want to programatically send text messages to your customers from your Zoho CRM (Contacts, Leads e.t.c). Basically you are required to setup / create a button on your zoho crm on the List View page (Mass Action Menu) and make it call GET the give URL.

GETBasic Usage
https://api.textng.xyz/zoho/?Tfk=0719271b50e9b2650d15337286c61f96&phone=${Contacts.Phone},${Contacts.Mobile},&key=YOUR-ACCOUNT-KEY&cvv=XXVcBDGhh67ZQQPVyuTR45PPXzzMsSFg569PWeMTxy
Rate: There is no limit to how many times you can call the API.
Field(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
Plain Text Response on successful for single sms
x units used|| Status:Successful|| Route:6/5/2|| Type:single number|| Reference:##########
Plain Text Response on successful for multiple sms
x units used|| Status:Successful|| Route:6/5/2|| Type:Multiple numbers(X)|| Reference:##########
Plain Text Response on error for Invalid Key
ERROR invalid KEY
Plain Text Response on error for insufficient SMS units
ERROR insufficient units
Plain Text Response on other errors
ERROR (the error description would be displayed here)




VOICE OTPS


The API is used when you want to programatically send OTPs to your customers using a voice call. This can be integrated in your application to get the job done. Basically you are required to call POST the give URL.

POST Basic Usage
https://api.textng.xyz/voice-otp/
Rate: 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
Field(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
phone Required "080xxxxxxxxx" This is the phone number you are sending the voice otp to. Only one number per transaction is allowed
message-opt-code Required "XXXXXX" This is OTP code to be sent to the customer.
otp-repeat Required "1 / 2" This is the number of times you want the OTP Code to read out to the customer when the customer is called.
custome_ref This is the tracking / tracing code parameter sent to us and used to track each transaction you pushed
POST Example Code (PHP)
  
  //using cURL POST
  
  <?php
    //Your variables
    $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; 
    }
  ?>
  
JSON Response on successful
{"status":"Successful","units_used":"4","type":"single number","otp-repeated":"2times","reference":"XXXXXXXXXXXXXXXXXX","custom_ref":"XXXXXXXXXXXXXXXXXXXXXXXXX","route":"VOICE-OTP"}
JSON Response on all error
{"status":"ERROR","comment":"THE REASON FOR THE ERROR WILL BE DISPLAYED HERE"}




VOICE / ROBOCALL / TEXT-TO-SPEECH


The API is used when you want to programatically send voice call / robocalls to your customers. This can be integrated in your application to get the job done. Basically you are required to call POST GET the give URL.

POST GET Basic Usage
https://api.textng.xyz/voice/
Rate: 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
Limit: Up to 20,000 numbers are allowed in a single API call
Field(Parameters) Example Description
key Required This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
phone Required "080xxxxxxxxx,080xxxxxxxx" This is the phone number you are sending the voice message to. Separate each number with commas (,)
message Required "Hello World, how are you" This is voice message to be played to the customer when the phone is picked.
custome_ref This is the tracking / tracing code parameter sent to us and used to track each transaction you pushed
POST Example Code (PHP)
  
  //using cURL POST
  
  <?php
    //Your variables
    $key="YOUR-ACCOUNT-KEY";
    $phone="080XXXXXXXX,080XXXXXXXXX,090XXXXXXXXXX";
    $message="My Voice Message";
    $custom_ref="REFERENCE-ID";
    
    $response = httpPost("https://api.textng.xyz/voice/",array("key"=>"$key","phone"=>"$phone","message"=>"$message","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;
    }
  ?>
  
JSON Response on successful
{"status":"Successful","units_used":"4","type":"single number","reference":"XXXXXXXXXXXXXXXXXX","custom_ref":"XXXXXXXXXXXXXXXXXXXXXXXXX","route":"VOICE-BROADCAST"}
JSON Response on all error
{"status":"ERROR","comment":"THE REASON FOR THE ERROR WILL BE DISPLAYED HERE"}