Delivery reports on Notify URL

Receive Delivery reports and custom data on your callback server's Notify URL.

Unlike the Getting delivery reports API method, where reports are pulled and received in the response, you are able to set a Notify URL on your callback server to which we will push the delivery reports.

Notify URL is set as one of the parameters of the Fully featured textual message API method.

As soon as the delivery reports for sent messages are received in the Infobip system, they will be forwarded to the specified Notify URL on your callback server. Besides the Notify URL, you can also specify Notify content type for delivery reports.

Supported content types:

  • application/json
  • application/xml

Example

The example bellow shows how to set notifyURL and notifyContentType for the delivery report and the user’s callbackData.

Send Push notification request

POST /push/2/message/single HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
 
{
    "from": "d417d38814740a23f50b5c876e226445-0f700564-abbf-4b5b-beae-86a4ef410904",
    "to": {
        "externalUserId": "customer_21234"
    },
    "text": "Message text",
    "notifyUrl": "http://example.com",
    "notifyContentType" : "application/json",
    "callbackData" : "Delivery report callback data"
}	
  

Send Push notification response

{
    "bulks": [
        {
            "to": {
                "externalUserId": "customer_21234"
            },
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 26,
                "name": "PENDING_ACCEPTED",
                "description": "Message accepted, pending for delivery"
            },
            "messageCount": 1,
            "bulkId": "czztgteet4fath2pclbq"
        }
    ]
}	
  

The results you will receive on your Notify URL will be the same as Getting delivery reports over the API method, except the XML root element name which is the same for all reports - <reportResponse>.

Report

{
    "results": [{
        "bulkId": "czztgteet4fath2pclbq",
        "price": {
            "pricePerMessage": 0.000000,
            "currency": "UNKNOWN"
        },
        "status": {
            "id": 5,
            "groupId": 3,
            "groupName": "DELIVERED",
            "name": "DELIVERED_TO_HANDSET",
            "description": "Message delivered to handset"
        },
        "error": {
            "id": 0,
            "name": "NO_ERROR",
            "description": "No Error",
            "groupId": 0,
            "groupName": "OK",
            "permanent": false
        },
        "messageId": "45653761-3a88-4060-869e-ae372adc7a51",
        "doneAt": "2017-10-27T10:20:08.562+0300",
        "messageCount": 1,
        "sentAt": "2017-10-27T10:20:07.197+0300",
        "callbackData": "{\"callbackData\":\"Delivery report callback data\",\"subscriberId\":\"customer_21234\"}",
        "to": "3fd5c8a4-ae57-46c1-be7a-31bb8a0a7fba",
        "channel": "PUSH"
    }]
}