Delivery reports vs. Logs

Learn about the difference between one time delivery reports and message logs history.

If you were wondering which one of these two to use, this tutorial will help you as it covers the difference between logs and delivery reports.

Logs and reports carry similar information about sent messages. Once you retrieve a delivery report, you will not be able to get the same report again. As opposed to delivery reports, logs can be requested more than once.

Important

Logs should be used for statistical analysis only.

Delivery reports should be used for message delivery status information purposes. They can be collected over the API call or received in real-time over HTTP forward method by supplying your notifyUrl when sending a message.

HTTP forward method is the most efficient way to access delivery reports since each delivery report is forwarded to your address as soon as the status becomes available and it is the recommended method for collecting message status information.

Delivery reports: HTTP forward example

Receive delivery reports for your sent messages in real time by specifying your unique URL where delivery reports will be forwarded via an HTTP POST request. Use the fully-featured SMS method to define notifyUrl as shown in this example:

POST /sms/1/text/advanced HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json

{
    "messages": [
        {
            "destinations": [
                {
                    "to": "38598111"
                }
            ],
            "text": "I like my DRs to be deliverd to me in real time.",
            "notifyUrl":"http://www.myDomain.com/deliveryReports"
        }
    ]
}	
  

When your Delivery report is ready, you will receive it at the supplied address.

{  
   "results":[  
      {  
         "bulkId":"08fe4407-c48f-4d4b-a2f4-9ff583c985b8",
         "messageId":"12db39c3-7822-4e72-a3ec-c87442c0ffc5",
         "to":"38598111",
         "sentAt":"2015-02-27T17:40:31.773+0100",
         "doneAt":"2015-02-27T17:40:31.787+0100",
         "smsCount":1,
         "price":{  
            "pricePerMessage":0.01,
            "currency":"EUR"
         },
         "status":{  
            "groupId":3,
            "groupName":"DELIVERED",
            "id":5,
            "name":"DELIVERED_TO_HANDSET",
            "description":"Message delivered to handset"
         },
         "error":{  
            "groupId":0,
            "groupName":"OK",
            "id":0,
            "name":"NO_ERROR",
            "description":"No Error",
            "permanent":false
         }
      }
   ]
}	
  

Delivery reports: Pull example

You have sent a bulk SMS message to 200 recipients a minute ago and you can't wait to see the results.

GET /sms/1/reports HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json	
  

The first time you request delivery reports, you will only receive an array of results for messages that have a terminal (final) status:

HTTP/1.1 200 OK
Content-Type: application/json

{  
   "results":[  
      {  
         "bulkId":"08fe4407-c48f-4d4b-a2f4-9ff583c985b8",
         "messageId":"bcfb828b-7df9-4e7b-8715-f34f5c61271a",
         "to":"38598111",
         "sentAt":"2015-02-26T17:41:11.833+0100",
         "doneAt":"2015-02-26T17:41:11.843+0100",
         "smsCount":1,
         "price":{  
            "pricePerMessage":0.01,
            "currency":"EUR"
         },
         "status":{  
            "groupId":3,
            "groupName":"DELIVERED",
            "id":5,
            "name":"DELIVERED_TO_HANDSET",
            "description":"Message delivered to handset"
         },
         "error":{  
            "groupId":0,
            "groupName":"Ok",
            "id":0,
            "name":"NO_ERROR",
            "description":"No Error",
            "permanent":false
         }
      },
      {  
         "bulkId":"08fe4407-c48f-4d4b-a2f4-9ff583c985b8",
         "messageId":"12db39c3-7822-4e72-a3ec-c87442c0ffc5",
         "to":"385981112",
         "sentAt":"2015-02-27T17:40:31.773+0100",
         "doneAt":"2015-02-27T17:40:31.787+0100",
         "smsCount":1,
         "price":{  
            "pricePerMessage":0.01,
            "currency":"EUR"
         },
         "status":{  
            "groupId":3,
            "groupName":"DELIVERED",
            "id":5,
            "name":"DELIVERED_TO_HANDSET",
            "description":"Message delivered to handset"
         },
         "error":{  
            "groupId":0,
            "groupName":"OK",
            "id":0,
            "name":"NO_ERROR",
            "description":"No Error",
            "permanent":false
         }
      }
   ]
}	
  

Reports listed above are now marked as read and will not be shown again.

If you request delivery reports again in a couple of minutes you will only get the remaining results, the ones you haven’t seen before. So, delivery reports are ideal to use if you want to track changes, to see what happened after the last received delivery report.

Logs example

You have sent out a lot of promotional SMS messages and want to conduct a statistical analysis of the delivery rate with a generated report. In this case, you should request logs and set a filter for a specific messageId.

GET /sms/1/logs?messageId=2df1d520-714c-4b1c-ba71-8b189df34954,c82cb129-1564-435f-2f51-34b750dc5c75 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json	
  

messageId is not the only parameter you can use as a filter. The entire list of available parameters is available here.

The response contains information about all the messages you have sent during the past 48 hours, their delivery statuses and some additional information. It looks like this:

HTTP/1.1 200 OK
Content-Type: application/json

{  
   "results":[  
      {  
         "bulkId":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
         "messageId":"2df1d520-714c-4b1c-ba71-8b189df34954",
         "to":"41793026727",
         "from":"InfoSMS",
         "text":"Test SMS.",
         "sentAt":"2015-06-17T17:41:11.833+0100",
         "doneAt":"2015-06-17T17:41:11.843+0100",
         "smsCount":1,
         "mccmnc":"22801",
         "price":{  
            "pricePerMessage":0.01,
            "currency":"EUR"
         },
         "status":{  
            "groupId":3,
            "groupName":"DELIVERED",
            "id":5,
            "name":"DELIVERED_TO_HANDSET",
            "description":"Message delivered to handset"
         },
         "error":{  
            "groupId":0,
            "groupName":"OK",
            "id":0,
            "name":"NO_ERROR",
            "description":"No Error",
            "permanent":false
         }
      },
      {  
         "bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
         "messageId":"c82cb129-1564-435f-2f51-34b750dc5c75",
         "to":"41793026727",
         "from":"InfoSMS",
         "text":"Test SMS.",
         "sentAt":"2015-06-16T17:40:31.773+0100",
         "doneAt":"2015-06-16T17:40:31.787+0100",
         "smsCount":1,
         "mccmnc":"22801",
         "price":{  
            "pricePerMessage":0.01,
            "currency":"EUR"
         },
         "status":{  
            "groupId":3,
            "groupName":"DELIVERED",
            "id":5,
            "name":"DELIVERED_TO_HANDSET",
            "description":"Message delivered to handset"
         },
         "error":{  
            "groupId":0,
            "groupName":"OK",
            "id":0,
            "name":"NO_ERROR",
            "description":"No Error",
            "permanent":false
         }
      }
   ]
}	
  

Important:

SMS logs are available for the last 48 hours!

With logs, you can see the result for your messages regardless of their current status.