Dashboard

Receiving Delivery Receipts

Receive an SMS delivery receipt (DLR) from SMS Expert.

If requested SMS Expert will do a HTTPs/POST from our web-based server to your server containing a delivery receipt for every SMS sent.

Please use the dashboard to configure the default URL of where you want delivery receipts forwarded to.

The default URL can also be overridden for any text message by specifying an alternative URL when calling the API to send an SMS.

The POST will contain XML defining the delivery receipt. If a user defined parameter was specified when the SMS was sent, this will also be available within a separate GET parameter.
https/post callhttp://www.mydomain.com/handler.php
parameters (POST)$xml [as defined below...]
<?xml version="1.0" encoding="ISO-8859-1"?>
  <itagg_delivery_receipt>
    <version>1.1</version>
    <msisdn>447123456789</msisdn>
    <submission_ref>123456</submission_ref>
    <status>Delivered</status>            
    <reason>4</reason>
    <retry>0</retry>
</itagg_delivery_receipt>
The <submission_ref> value will match the submission reference returned in the Send SMS API.

<submission_ref> and <msisdn> should be combined as a unique key to locate the matching SMS in your database.
parameters (GET)$userid [as defined in the Send SMS API]
DLR reasons <status> and <reason> will indicate the SMS delivery status.

At the time of writing the following are the possible <status> and <reason> values, shown here separated by a "|" pipe character.

Intermediate status
  1|Buffered: Phone related
  2|Buffered: Deliverer Related: Message Within Operator
  3|Acknowledged: Accepted by SMSC
  7|Buffered: Credit related. Message may be being retried

Final status - success
  4|Delivered to mobile device

Final status - failure
  5|Failed, no further information available
  6|The final status of the message is unknown
  8|Message expired within the operator, failure reason unknown
  20|Permanent Operator error
  21|Credit related: Message has been retried by operator
  22|Credit related: Message has NOT been retried
  23|Absent Subscriber Permanent
  24|Absent Subscriber Temporary
  25|Operator Network Failure
  26|Phone Related Error
  27|Barred by User / Permanent Phone related error
  28|Anti-Spam
  29|Content Related
  33|Previously had parental lock applied
  34|Previously failed to age verify
  35|Previously not age verified
  36|Temporary communication error with AV platform
  37|Failed, no further information available
  38|Buffered: Deliverer Related
  39|The final status of the message is unknown
  40|Failed, no further information available
  41|The final status of the message is unknown
  42|The final status of the message is unknown

New status codes above 42 may be added from time to time and they will always indicate final status - failure.

Sample Code...
PHP

<?php
class XMLAssocArray {

  var $arrays, $keys, $node_flag, $depth, $xml_parser;

  function xml2array($xml) {
    $this->depth = -1;
    $this->xml_parser = xml_parser_create();
    xml_set_object($this->xml_parser, $this);
    xml_parser_set_option ($this->xml_parser, XML_OPTION_CASE_FOLDING, 0);
    xml_set_element_handler($this->xml_parser, "startElement", "endElement");
    xml_set_character_data_handler($this->xml_parser, "characterData");
    xml_parse($this->xml_parser, $xml, true);
    xml_parser_free($this->xml_parser);
    return $this->arrays[1];
  }

  function startElement($parser, $name, $attrs) {
    $this->keys[] = $name;
    $this->node_flag = 1;
    $this->depth++;
  }

  function characterData($parser,$data) {
    $key = end($this->keys);
    $this->arrays[$this->depth][$key] = $data;
    $this->node_flag = 0;
  }

  function endElement($parser, $name) {
    $key = array_pop($this->keys);
    if($this->node_flag == 1) {
      $this->arrays[$this->depth][$key] = $this->arrays[$this->depth + 1];
      unset($this->arrays[$this->depth + 1]);
    }
    $this->node_flag = 1;
    $this->depth--;
  }
}

$userid = $_GET["userid"];
$xml = $_POST["xml"];
$parser = new XMLAssocArray();
$arr = $parser->xml2array($xml);
$subref = $arr["submission_ref"];
$msisdn = $arr["msisdn"];
$status = $arr["status"];
$reason = $arr["reason"];
$retry = $arr["retry"];

mail(
  "yourself@mydomain.com",
  "DLR for SMS to $msisdn: $status",
  "Mobile number: $msisdn\r\n
   Submission reference: $subref\r\n
   Delivered reason: $reason\r\n
   Status: $status\r\n
   Retry: $retry\r\n
   userid: $userid\r\n
   $XML: $xml\r\n",
  "From: yourself@mydomain.com\r\nReply-To: yourself@mydomain.com\r\n");

print("OK"); //always return "OK" to let SMS Expert know it was received
?>

Support Home
Introduction

Main dashboard
Campaign manager
SMS Expert home page
Sending SMS (http)
Send outbound SMS
Receive delivery receipts
Sending SMS (smpp)
Please call for details
Receiving SMS
Receive inbound SMS
Wallet Balances
SMS + keyword balances
Keyword Tools
Keyword availability
Register keyword
Set keyword forwarding

List keywords
Renew keyword
Delete keyword
Replace keyword

Tool response codes