Delivery reports for Click to call
This method allows you to get one time delivery reports for sent calls.
Resource
https://api.infobip.com/tts/3/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 | The maximum number of returned delivery reports. Default value is 50. |
Request Example
GET /tts/3/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",
"duration":10,
"mccMnc": "21901",
"dtmfCodes":"1",
"price":{
"pricePerSecond":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": 5000,
"name": "VOICE_ANSWERED",
"description": "Call answered by human",
"permanent": true
}
}
]
}
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.
VoiceReportResponse
| Parameter | Type | Description |
|---|---|---|
| results | VoiceReport | Collection of reports, one per every message. |
VoiceReport
| Parameter | Type | Description |
|---|---|---|
| bulkId | String | Bulk ID. |
| messageId | String | Message ID. |
| to | String | Destination address. |
| sentAt | Date | Tells when the voice message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. |
| doneAt | Date | Tells when the voice message was processed by Infobip (ie. delivered to destination, delivered to destination network, etc.). |
| duration | int | Call duration in seconds. |
| mccMnc | String | Mobile country and network codes. |
| dtmfCodes | String | DTMF code entered by user. |
| price | Price | Sent voice message 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 second of the voice message. |
| 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. |
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 /tts/3/reports HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /tts/3/reports HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xmlcurl -X GET \
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
"http://api.infobip.com/tts/3/reports"<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.infobip.com/tts/3/reports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
"content-type: application/json"
),
));
$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("http://api.infobip.com/tts/3/reports")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_bodyimport http.client
conn = http.client.HTTPConnection("api.infobip.com")
payload = ""
headers = {
'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("GET", "/tts/3/reports", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))HttpResponse<String> response = Unirest.get("http://api.infobip.com/tts/3/reports")
.header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.asString();var client = new RestClient("http://api.infobip.com/tts/3/reports");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
IRestResponse response = client.Execute(request);var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "http://api.infobip.com/tts/3/reports");
xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
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",
"duration":10,
"mccMnc": "21901",
"dtmfCodes":"1",
"price":{
"pricePerSecond":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": 5000,
"name": "VOICE_ANSWERED",
"description": "Call answered by human",
"permanent": true
}
}
]
}
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>
<duration>10</duration>
<mccMnc>21901</mccMnc>
<dtmfCodes>1</dtmfCodes>
<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>5000</id>
<name>VOICE_ANSWERED</name>
<description>Call answered by human</description>
<permanent>true</permanent>
</error>
</result>
</results>
</reportResponse>Getting the two initial delivery reports
Request
GET /tts/3/reports?limit=2 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /tts/3/reports?limit=2 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xmlcurl -X GET
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
-H "Content-Type: application/json"
-H "Accept: application/json"
"http://api.infobip.com/tts/3/reports?limit=2"<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.infobip.com/tts/3/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_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
"content-type: application/json"
),
));
$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("http://api.infobip.com/tts/3/reports?limit=2")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_bodyimport http.client
conn = http.client.HTTPConnection("api.infobip.com")
payload = ""
headers = {
'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("GET", "/tts/3/reports?limit=2", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))HttpResponse<String> response = Unirest.get("http://api.infobip.com/tts/3/reports?limit=2")
.header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.asString();var client = new RestClient("http://api.infobip.com/tts/3/reports?limit=2");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
IRestResponse response = client.Execute(request);var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "http://api.infobip.com/tts/3/reports?limit=2");
xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
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",
"duration":10,
"mccMnc": "21901",
"dtmfCodes":"1",
"price":{
"pricePerSecond":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": 5000,
"name": "VOICE_ANSWERED",
"description": "Call answered by human",
"permanent": true
}
},
{
"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",
"duration":10,
"dtmfCodes":"1",
"price":{
"pricePerSecond":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": 5000,
"name": "VOICE_ANSWERED",
"description": "Call answered by human",
"permanent": true
}
}
]
}
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>
<duration>10</duration>
<mccMnc>21901</mccMnc>
<dtmfCodes>1</dtmfCodes>
<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>5000</id>
<name>VOICE_ANSWERED</name>
<description>Call answered by human</description>
<permanent>true</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>
<duration>10</duration>
<mccMnc>21901</mccMnc>
<dtmfCodes>1</dtmfCodes>
<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>5000</id>
<name>VOICE_ANSWERED</name>
<description>Call answered by human</description>
<permanent>true</permanent>
</error>
</result>
</results>
</reportResponse>