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
Run Shortcode Request The API is used when you want to programatically run a shortcode query on your virtual number using the carrier billing service.
POST
https://api.textng.xyz/carrier_shortcode/
PHP code
<?php
  // Using cURL POST
  $key="YOUR-ACCOUNT-KEY";
  $bypasscode="BYPASS CODE SERVER KEY";
  $shortcode="SHORT CODE";
  $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;
  }
?>
Parameters
Parameters Example Description
Key * XXXXX-XXXX-XXXXX This can be found in the Developers page of your dashboard. The key authorizes the transaction.
Bypasscodes * XXXXXXXXXX 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 * 131 This is the destination shortcode you want to send a message to on the specified bypass code for the carrier billing service.
message * 2 This is the message you want to send to the shortcode on the specified bypass code for the carrier billing service.
Amount * 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 * XXXXX This is the push pin used to authorize the query to run on the carrier billing service
Responses
Succesful query (JSON)
{
    "D":{
    "details":[
        {
            "status":"successful",
            "ref_id":"REFERENCE_ID",
            "query":"SHORTCODE_QUERY_PUSHED",
            "type":"SHORTCODE"
            }
        ]
    }
}
Error - Bypass code authentication (JSON)
{
    "D":{
    "details":[
        {
        "status":"error-bypasscode-expired-or-not-exist"
        }]
    }
}
Error - Incorrect push pin (JSON)
{
    "D":{
        "details":[
        {
            "status":"incorrect-push-pin"
        }]
    }
}
Error - Invalid key (JSON)
{
    "D":{
        "details":[
            {
            "status":"error-key-invalid"
            }
        ]
    }
}