Email delivery reports

This method allows you to get one time delivery reports for sent emails.

Resource

https://api.infobip.com/email/1/reports

Parameters

Property name Type Description
bulkId string The ID uniquely identifies a group of Email requests. This filter will enable you to query delivery reports for all the messages with the same bulk id using just one request.
messageId string Message ID for which report is requested.
limit int Maximum number of reports.

Request Example

					GET /email/1/reports HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
					
				

Response

					{
  "results": [
    {
      "messageId": "bbcc6960-1fcb-497c-b7ea-83ccba41492e",
      "to": "recipient@infobip.com",
      "sentAt": "2016-08-31T13:25:18.477+0000",
      "doneAt": "2016-08-31T13:25:50.893+0000",
      "messageCount": 1,
      "price": {
        "pricePerMessage": 0,
        "currency": "UNKNOWN"
      },
      "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
      },
      "channel": "EMAIL"
    }
  ]
}
					
				

Response format

If successful, the response header HTTP status code will be 200 OK and delivery reports will be returned in the response body.

If you try to send a message without authorization, you will get a response with HTTP status code 401 Unauthorized.

Parameter Type Description
results SentEmailReport Collection of reports, one per email.

SentEmailReport

Parameter Type Description
messageId String Message ID.
to String Destination address.
sentAt Date Tells when the email was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ.
doneAt Date Tells when the email was finished processing by Infobip (ie. delivered to destination).
messageCount int Indicates how many parts the message was split into. It will always be one for email.
price Price Sent email price.
status Status Indicates whether the message is successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status.
error Error Indicates whether any error occurred during query execution.

Price

Parameter Type Description
pricePerMessage BigDecimal Price per one Email.
currency String The currency in which the price is expressed.

Status

Parameter Type Description
groupId int Status group ID.
groupName String Status group name.
id int Status ID.
name String Status name.
description String Human-readable description of the status.
action String Action that should be taken to eliminate the error.

Error

Parameter Type Description
groupId int Error group ID.
groupName String Error group name.
id int Error ID.
name String Error name.
description String Human-readable description of the error.
permanent boolean Tells if the error is permanent.

Delivery report will be returned only once!

Delivery reports are returned only once. Additional delivery report request will return an empty collection.

Additional examples

Get reports by message id

Request:

GET /email/1/reports?messageId=bbcc6960-1fcb-497c-b7ea-83ccba41492e HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /email/1/reports HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml
curl -X GET \
-H 'Accept: application/json' \
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" \
https://api.infobip.com/email/1/reports
<?php

$request = new HttpRequest();
$request->setUrl('https://api.infobip.com/email/1/reports');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'accept' => 'application/json',
  'authorization' => 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
require 'uri'
require 'net/http'

url = URI("https://api.infobip.com/email/1/reports")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.infobip.com")

headers = {
    'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    'accept': "application/json"
    }

conn.request("GET", "/email/1/reports", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://api.infobip.com/email/1/reports")
  .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
  .header("accept", "application/json")
  .asString();
var client = new RestClient("https://api.infobip.com/email/1/reports");

var request = new RestRequest(Method.GET);
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");

IRestResponse response = client.Execute(request);
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.infobip.com/email/1/reports");
xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

Response:

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

{
  "results": [
    {
      "messageId": "bbcc6960-1fcb-497c-b7ea-83ccba41492e",
      "to": "recipient@infobip.com",
      "sentAt": "2016-08-31T13:25:18.477+0000",
      "doneAt": "2016-08-31T13:25:50.893+0000",
      "messageCount": 1,
      "price": {
        "pricePerMessage": 0,
        "currency": "UNKNOWN"
      },
      "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
      },
      "channel": "EMAIL"
    }
    ]
}
HTTP/1.1 200 OK
Content-Type: application/json

<?xml version='1.0' encoding='UTF-8'?>
<ReportsResponse>
    <results>
        <result>
            <messageId>bbcc6960-1fcb-497c-b7ea-83ccba41492e</messageId>
            <to>recipient@infobip.com</to>
            <sentAt>2016-08-31T13:25:18.477+0000</sentAt>
            <doneAt>2016-08-31T13:25:50.893+0000</doneAt>
            <messageCount>1</messageCount>
            <price>
                <pricePerMessage>0</pricePerMessage>
                <currency>UNKNOWN</currency>
            </price>
            <status>
                <groupId>3</groupId>
                <groupName>DELIVERED</groupName>
                <id>5</id>
                <name>DELIVERED_TO_HANDSET</name>
                <description>Message delivered to handset</description>
            </status>
            <error>
                <groupId>0</groupId>
                <groupName>OK</groupName>
                <id>0</id>
                <name>NO_ERROR</name>
                <description>No Error</description>
                <permanent>false</permanent>
            </error>
            <channel>EMAIL</channel>
        </result>
    </results>
</ReportsResponse>

Get the initial two delivery reports

Request:

GET /email/1/reports?limit=2 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /email/1/reports?limit=2 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml
curl -X GET \
-H 'Accept: application/json' \
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" \
https://api.infobip.com/email/1/reports?limit=2
<?php

$request = new HttpRequest();
$request->setUrl('https://api.infobip.com/email/1/reports');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'limit' => '2'
));

$request->setHeaders(array(
  'accept' => 'application/json',
  'authorization' => 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
require 'uri'
require 'net/http'

url = URI("https://api.infobip.com/email/1/reports?limit=2")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.infobip.com")

headers = {
    'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    'accept': "application/json"
    }

conn.request("GET", "/email/1/reports?limit=2", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://api.infobip.com/email/1/reports?limit=2")
  .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
  .header("accept", "application/json")
  .asString();
var client = new RestClient("https://api.infobip.com/email/1/reports?limit=2");

var request = new RestRequest(Method.GET);
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");

IRestResponse response = client.Execute(request);
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.infobip.com/email/1/reports?limit=2");
xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

Response:

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

{
  "results": [
    {
      "messageId": "bbcc6960-1fcb-497c-b7ea-83ccba41492e",
      "to": "recipient@infobip.com",
      "sentAt": "2016-08-31T13:25:18.477+0000",
      "doneAt": "2016-08-31T13:25:50.893+0000",
      "messageCount": 1,
      "price": {
        "pricePerMessage": 0,
        "currency": "UNKNOWN"
      },
      "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
      },
      "channel": "EMAIL"
    },
    {
      "messageId": "a3ee6933-1fcb-497c-b7ea-83cdda55543f",
      "to": "recipient2@infobip.com",
      "sentAt": "2016-08-31T13:25:19.455+0000",
      "doneAt": "2016-08-31T13:25:51.233+0000",
      "messageCount": 1,
      "price": {
        "pricePerMessage": 0,
        "currency": "UNKNOWN"
      },
      "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
      },
      "channel": "EMAIL"
    }
    ]
}
HTTP/1.1 200 OK
Content-Type: application/json

<?xml version='1.0' encoding='UTF-8'?>
<ReportsResponse>
    <results>
        <result>
            <messageId>bbcc6960-1fcb-497c-b7ea-83ccba41492e</messageId>
            <to>recipient@infobip.com</to>
            <sentAt>2016-08-31T13:25:18.477+0000</sentAt>
            <doneAt>2016-08-31T13:25:50.893+0000</doneAt>
            <messageCount>1</messageCount>
            <price>
                <pricePerMessage>0</pricePerMessage>
                <currency>UNKNOWN</currency>
            </price>
            <status>
                <groupId>3</groupId>
                <groupName>DELIVERED</groupName>
                <id>5</id>
                <name>DELIVERED_TO_HANDSET</name>
                <description>Message delivered to handset</description>
            </status>
            <error>
                <groupId>0</groupId>
                <groupName>OK</groupName>
                <id>0</id>
                <name>NO_ERROR</name>
                <description>No Error</description>
                <permanent>false</permanent>
            </error>
            <channel>EMAIL</channel>
        </result>
        <result>
            <messageId>a3ee6933-1fcb-497c-b7ea-83cdda55543f</messageId>
            <to>recipient2@infobip.com</to>
            <sentAt>2016-08-31T13:25:19.455+0000</sentAt>
            <doneAt>2016-08-31T13:25:51.233+0000</doneAt>
            <messageCount>1</messageCount>
            <price>
                <pricePerMessage>0</pricePerMessage>
                <currency>UNKNOWN</currency>
            </price>
            <status>
                <groupId>3</groupId>
                <groupName>DELIVERED</groupName>
                <id>5</id>
                <name>DELIVERED_TO_HANDSET</name>
                <description>Message delivered to handset</description>
            </status>
            <error>
                <groupId>0</groupId>
                <groupName>OK</groupName>
                <id>0</id>
                <name>NO_ERROR</name>
                <description>No Error</description>
                <permanent>false</permanent>
            </error>
            <channel>EMAIL</channel>
        </result>
    </results>
</ReportsResponse>

Get reports by bulkId

Request:

GET /email/1/reports?bulkId=lrzkq6gatdkxouhrkgni HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /email/1/reports?bulkId=lrzkq6gatdkxouhrkgni HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml
curl -X GET \
-H 'Accept: application/json' \
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" \
https://api.infobip.com/email/1/reports?bulkId=lrzkq6gatdkxouhrkgni
<?php

$request = new HttpRequest();
$request->setUrl('https://api.infobip.com/email/1/reports');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'bulkId' => 'lrzkq6gatdkxouhrkgni'
));

$request->setHeaders(array(
  'accept' => 'application/json',
  'authorization' => 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
require 'uri'
require 'net/http'

url = URI("https://api.infobip.com/email/1/reports?bulkId=lrzkq6gatdkxouhrkgni")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.infobip.com")

headers = {
    'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    'accept': "application/json"
    }

conn.request("GET", "/email/1/reports?bulkId=lrzkq6gatdkxouhrkgni", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://api.infobip.com/email/1/reports?bulkId=lrzkq6gatdkxouhrkgni")
  .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
  .header("accept", "application/json")
  .asString();
var client = new RestClient("https://api.infobip.com/email/1/reports?bulkId=lrzkq6gatdkxouhrkgni");

var request = new RestRequest(Method.GET);
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");

IRestResponse response = client.Execute(request);
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.infobip.com/email/1/reports?bulkId=lrzkq6gatdkxouhrkgni");
xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

Response:

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

{
  "results": [
    {
      "bulkId": "lrzkq6gatdkxouhrkgni",
      "messageId": "bbcc6960-1fcb-497c-b7ea-83ccba41492e",
      "to": "recipient@infobip.com",
      "sentAt": "2016-08-31T13:25:18.477+0000",
      "doneAt": "2016-08-31T13:25:50.893+0000",
      "messageCount": 1,
      "price": {
        "pricePerMessage": 0,
        "currency": "UNKNOWN"
      },
      "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
      },
      "channel": "EMAIL"
    },
    {
      "bulkId": "lrzkq6gatdkxouhrkgni",
      "messageId": "a3ee6933-1fcb-497c-b7ea-83cdda55543f",
      "to": "recipient2@infobip.com",
      "sentAt": "2016-08-31T13:25:19.455+0000",
      "doneAt": "2016-08-31T13:25:51.233+0000",
      "messageCount": 1,
      "price": {
        "pricePerMessage": 0,
        "currency": "UNKNOWN"
      },
      "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
      },
      "channel": "EMAIL"
    }
    ]
}
HTTP/1.1 200 OK
Content-Type: application/json

<?xml version='1.0' encoding='UTF-8'?>
<ReportsResponse>
    <results>
        <result>
            <bulkId>lrzkq6gatdkxouhrkgni</bulkId>
            <messageId>bbcc6960-1fcb-497c-b7ea-83ccba41492e</messageId>
            <to>recipient@infobip.com</to>
            <sentAt>2016-08-31T13:25:18.477+0000</sentAt>
            <doneAt>2016-08-31T13:25:50.893+0000</doneAt>
            <messageCount>1</messageCount>
            <price>
                <pricePerMessage>0</pricePerMessage>
                <currency>UNKNOWN</currency>
            </price>
            <status>
                <groupId>3</groupId>
                <groupName>DELIVERED</groupName>
                <id>5</id>
                <name>DELIVERED_TO_HANDSET</name>
                <description>Message delivered to handset</description>
            </status>
            <error>
                <groupId>0</groupId>
                <groupName>OK</groupName>
                <id>0</id>
                <name>NO_ERROR</name>
                <description>No Error</description>
                <permanent>false</permanent>
            </error>
            <channel>EMAIL</channel>
        </result>
        <result>
            <bulkId>lrzkq6gatdkxouhrkgni</bulkId>
            <messageId>a3ee6933-1fcb-497c-b7ea-83cdda55543f</messageId>
            <to>recipient2@infobip.com</to>
            <sentAt>2016-08-31T13:25:19.455+0000</sentAt>
            <doneAt>2016-08-31T13:25:51.233+0000</doneAt>
            <messageCount>1</messageCount>
            <price>
                <pricePerMessage>0</pricePerMessage>
                <currency>UNKNOWN</currency>
            </price>
            <status>
                <groupId>3</groupId>
                <groupName>DELIVERED</groupName>
                <id>5</id>
                <name>DELIVERED_TO_HANDSET</name>
                <description>Message delivered to handset</description>
            </status>
            <error>
                <groupId>0</groupId>
                <groupName>OK</groupName>
                <id>0</id>
                <name>NO_ERROR</name>
                <description>No Error</description>
                <permanent>false</permanent>
            </error>
            <channel>EMAIL</channel>
        </result>
    </results>
</ReportsResponse>