Get delivery reports
This method allows you to get one time delivery reports for sent SMS.
Resource
https://api.infobip.com/sms/1/reports
Parameters
Property name | Type | Description |
---|---|---|
bulkId | string | The ID that uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address. |
messageId | string | The ID that uniquely identifies the message sent. |
limit | string | Number of returned delivery reports. The default value is 50. Max number per request is 1000. |
Request Example
GET /sms/1/reports HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
Response
{
"results":[
{
"bulkId":"8c20f086-d82b-48cc-b2b3-3ca5f7aca9fb",
"messageId":"ff4804ef-6ab6-4abd-984d-ab3b1387e852",
"to":"385981178",
"sentAt":"2015-02-12T09:58:20.323+0100",
"doneAt":"2015-02-12T09:58:20.337+0100",
"smsCount":1,
"mccMnc": "21901",
"callbackData": "DLR callback data",
"price":{
"pricePerMessage":0.01,
"currency":"EUR"
},
"status":{
"id":5,
"groupId":3,
"groupName":"DELIVERED",
"name":"DELIVERED_TO_HANDSET",
"description":"Message delivered to handset"
},
"error":{
"groupId":0,
"groupName":"OK",
"id":0,
"name":"NO_ERROR",
"description":"No Error",
"permanent":false
}
}
]
}
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 the HTTP status code 401 Unauthorized
.
SMSReportResponse
Parameter | Type | Description |
---|---|---|
results | SentSMSReport | Collection of reports, one per every message. |
Sent SMS Report
Parameter | Type | Description |
---|---|---|
bulkId | String | Bulk ID. |
messageId | String | Message ID. |
to | String | Destination address. |
from | String | Sender ID that can be alphanumeric or numeric. |
sentAt | Date | Tells when the SMS was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ . |
doneAt | Date | Tells when the SMS was finished processing by Infobip (i.e., delivered to the destination, delivered to the destination network, etc.) |
smsCount | int | The number of parts the sent SMS was split into. |
mccMnc | String | Mobile country and network codes. |
callbackData | String | Callback data sent through callbackData field in fully featured SMS message. |
price | Price | Sent SMS 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 the error occurred during the query execution. |
Price
Parameter | Type | Description |
---|---|---|
pricePerMessage | BigDecimal | Price per one SMS. |
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
Getting reports without any query parameter
Request:
GET /sms/1/reports HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /sms/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/sms/1/reports
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.infobip.com/sms/1/reports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
require 'uri'
require 'net/http'
url = URI("https://api.infobip.com/sms/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", "/sms/1/reports", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://api.infobip.com/sms/1/reports")
.header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("accept", "application/json")
.asString();
var client = new RestClient("https://api.infobip.com/sms/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/sms/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":[
{
"bulkId":"8c20f086-d82b-48cc-b2b3-3ca5f7aca9fb",
"messageId":"ff4804ef-6ab6-4abd-984d-ab3b1387e852",
"to":"385981178",
"sentAt":"2015-02-12T09:58:20.323+0100",
"doneAt":"2015-02-12T09:58:20.337+0100",
"smsCount":1,
"mccMnc": "21901",
"price":{
"pricePerMessage":0.01,
"currency":"EUR"
},
"status":{
"id":5,
"groupId":3,
"groupName":"DELIVERED",
"name":"DELIVERED_TO_HANDSET",
"description":"Message delivered to handset"
},
"error":{
"groupId":0,
"groupName":"OK",
"id":0,
"name":"NO_ERROR",
"description":"No Error",
"permanent":false
}
}
]
}
HTTP/1.1 200 OK
Content-Type: application/xml
<reportResponse>
<results>
<result>
<bulkId>8c20f086-d82b-48cc-b2b3-3ca5f7aca9fb</bulkId>
<messageId>ff4804ef-6ab6-4abd-984d-ab3b1387e852</messageId>
<to>385981178</to>
<sentAt>2015-02-12T09:58:20.323+0100</sentAt>
<doneAt>2015-02-12T09:58:20.337+0100</doneAt>
<smsCount>1</smsCount>
<mccMnc>21901</mccMnc>
<price>
<pricePerMessage>0.01</pricePerMessage>
<currency>EUR</currency>
</price>
<status>
<id>5</id>
<groupId>3</groupId>
<groupName>DELIVERED</groupName>
<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>
</result>
</results>
</reportResponse>
Getting the initial two delivery reports
Request:
GET /sms/1/reports?limit=2 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /sms/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/sms/1/reports?limit=2
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.infobip.com/sms/1/reports?limit=2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
require 'uri'
require 'net/http'
url = URI("https://api.infobip.com/sms/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", "/sms/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/sms/1/reports?limit=2")
.header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("accept", "application/json")
.asString();
var client = new RestClient("https://api.infobip.com/sms/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/sms/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":[
{
"bulkId":"80664c0c-e1ca-414d-806a-5caf146463df",
"messageId":"bcfb828b-7df9-4e7b-8715-f34f5c61271a",
"to":"38598111",
"sentAt":"2015-02-12T09:58:20.323+0100",
"doneAt":"2015-02-12T09:58:20.337+0100",
"smsCount":1,
"mccMnc": "21901",
"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-12T09:58:20.345+0100",
"doneAt":"2015-02-12T09:58:20.350+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
}
}
]
}
HTTP/1.1 200 OK
Content-Type: application/xml
<reportResponse>
<results>
<result>
<bulkId>80664c0c-e1ca-414d-806a-5caf146463df</bulkId>
<messageId>bcfb828b-7df9-4e7b-8715-f34f5c61271a</messageId>
<to>38598111</to>
<sentAt>2015-02-12T09:58:20.323+0100</sentAt>
<doneAt>2015-02-12T09:58:20.337+0100</doneAt>
<smsCount>1</smsCount>
<mccMnc>21901</mccMnc>
<price>
<pricePerMessage>0.01</pricePerMessage>
<currency>EUR</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>
</result>
<result>
<bulkId>08fe4407-c48f-4d4b-a2f4-9ff583c985b8</bulkId>
<messageId>12db39c3-7822-4e72-a3ec-c87442c0ffc5</messageId>
<to>385981112</to>
<sentAt>2015-02-12T09:58:20.345+0100</sentAt>
<doneAt>2015-02-12T09:58:20.350+0100</doneAt>
<smsCount>1</smsCount>
<price>
<pricePerMessage>0.01</pricePerMessage>
<currency>EUR</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>
</result>
</results>
</reportResponse>
Getting a report via message ID
Request:
GET /sms/1/reports?messageId=ff4804ef-6ab6-4abd-984d-ab3b1387e852 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /sms/1/reports?messageId=ff4804ef-6ab6-4abd-984d-ab3b1387e852 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/sms/1/reports?messageId=ff4804ef-6ab6-4abd-984d-ab3b1387e852
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.infobip.com/sms/1/reports?messageId=ff4804ef-6ab6-4abd-984d-ab3b1387e852",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
require 'uri'
require 'net/http'
url = URI("https://api.infobip.com/sms/1/reports?messageId=ff4804ef-6ab6-4abd-984d-ab3b1387e852")
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", "/sms/1/reports?messageId=ff4804ef-6ab6-4abd-984d-ab3b1387e852", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("https://api.infobip.com/sms/1/reports?messageId=ff4804ef-6ab6-4abd-984d-ab3b1387e852")
.header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("accept", "application/json")
.asString();
var client = new RestClient("https://api.infobip.com/sms/1/reports?messageId=ff4804ef-6ab6-4abd-984d-ab3b1387e852");
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/sms/1/reports?messageId=ff4804ef-6ab6-4abd-984d-ab3b1387e852");
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":"8c20f086-d82b-48cc-b2b3-3ca5f7aca9fb",
"messageId":"ff4804ef-6ab6-4abd-984d-ab3b1387e852",
"to":"385981178",
"sentAt":"2015-02-12T09:58:20.323+0100",
"doneAt":"2015-02-12T09:58:20.337+0100",
"smsCount":1,
"mccMnc": "21901",
"price":{
"pricePerMessage":0.01,
"currency":"EUR"
},
"status":{
"id":5,
"groupId":3,
"groupName":"DELIVERED",
"name":"DELIVERED_TO_HANDSET",
"description":"Message delivered to handset"
},
"error":{
"groupId":0,
"groupName":"OK",
"id":0,
"name":"NO_ERROR",
"description":"No Error",
"permanent":false
}
}
]
}
HTTP/1.1 200 OK
Content-Type: application/xml
<reportResponse>
<results>
<result>
<bulkId>8c20f086-d82b-48cc-b2b3-3ca5f7aca9fb</bulkId>
<messageId>ff4804ef-6ab6-4abd-984d-ab3b1387e852</messageId>
<to>385981178</to>
<sentAt>2015-02-12T09:58:20.323+0100</sentAt>
<doneAt>2015-02-12T09:58:20.337+0100</doneAt>
<smsCount>1</smsCount>
<mccMnc>21901</mccMnc>
<price>
<pricePerMessage>0.01</pricePerMessage>
<currency>EUR</currency>
</price>
<status>
<id>5</id>
<groupId>3</groupId>
<groupName>DELIVERED</groupName>
<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>
</result>
</results>
</reportResponse>