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
Carrier Callback The API is used to receive USSD / Shortcodes query response.
💡 USAGE Set callback URL on your Textng Account to receive USSD / Shortcode query responses. To set-up the Callback url, kindly visit the Personalize page and insert your callback url in the appropraite input field. Below is a template of how your callback URL should be.
PHP code
<?php
  if (getenv('REQUEST_METHOD') == 'POST') {
      $postData = file_get_contents("php://input");
      if (!empty($postData)) {
          $decode = json_decode($postData, true);
          $extracted_data = $decode;
          echo $refid = $extracted_data->ref_id;
          echo $response = $extracted_data->response;
          echo $query = $extracted_data->query;
      }
  }
?>
Response
Sample response pushed (JSON)
{
      "ref_id": "969045705862619208",
      "query": "*556#",
      "response": "BizPlus Main account:N100.00;  NEW! Get 6x MORE when you recharge with *888*PIN# today.Details via SMS."
    }