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
SMS Webhooks The API is used when you want to receive realyime delivery status of messages you have sent.
💡 USAGE Set DLR webhooks on your Textng Account to receive realtime delivery reports for your messages. To set-up the Callback url, kindly visit the Account Settings 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);
          $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;
          }
      }
  }
?>
Response
Sample DLR pushed (JSON)
{
    "D":{
        "details":[
            {
            "number":"234XXXXXXXXX",
            "status":"DELIVERED",
            "track_id":"xxxxxxxxxx",
            "timesent":"TIME-MESSAGE-WAS-SENT",
            "custom_ref":"xxxxxxxxxx"
            }
        ]
    }
}