Delivery reports for voice messages
This method allows you to get one time delivery reports for sent voice message.
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": "2018-06-25T13:38:14.730+0000",
"doneAt": "2018-06-25T13:38:28.318+0000",
"startTime": "2018-06-25T13:38:15.000+0000",
"endTime": "2018-06-25T13:38:28.316+0000",
"answerTime": "2018-06-25T13:38:25.000+0000",
"duration":10,
"fileDuration": 19.3,
"mccMnc": "21901",
"callbackData": "DLR callback data",
"dtmfCodes":"1",
"recordedAudioFileUrl":"/tts/3/files/ff4804ef-6ab6-4abd-984d-ab3b1387e852/385981178",
"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.). |
| startTime | Date | Tells when the voice message call was established and started ringing. |
| endTime | Date | Tells when the voice message call was ended. |
| answerTime | Date | Tells when the voice message call was answered. |
| duration | int | Duration of the Voice message call. |
| fileDuration | Double | Duration of the Voice message audio file. |
| mccMnc | String | Mobile country and network codes. |
| callbackData | String | Callback data sent through callbackData field in fully featured Voice message. |
| dtmfCodes | String | DTMF code entered by user. |
| recordedAudioFileUrl | String | Url to retrieve recorded calls that were made by messages with the record feature activated. |
| 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 |
|---|---|---|
| pricePerSecond | 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. |
Recorded Audio File
If the option to record was enabled, the response will contain the recordedAudioFileUrl field. Using that URL with GET method will initiate the download of the recorded file. If using a REST testing client, make sure to save the downloaded data instead of displaying it in the client’s response area.
Recordings are encoded as PCM WAVE signed little-endian 16bit 8kHz audio files.
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",
"sentAt": "2018-06-25T13:38:14.730+0000",
"doneAt": "2018-06-25T13:38:28.318+0000",
"startTime": "2018-06-25T13:38:15.000+0000",
"endTime": "2018-06-25T13:38:28.316+0000",
"answerTime": "2018-06-25T13:38:25.000+0000",
"duration":10,
"fileDuration": 19.3,
"mccMnc": "21901",
"callbackData": "DLR callback data",
"dtmfCodes":"1",
"recordedAudioFileUrl":"/tts/3/files/ff4804ef-6ab6-4abd-984d-ab3b1387e852/385981178",
"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>
<recordedAudioFileUrl>https://api.infobip.com/tts/3/files/ff4804ef-6ab6-4abd-984d-ab3b1387e852/385981178</recordedAudioFileUrl>
<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",
"startTime": "2018-06-25T13:38:15.000+0000",
"endTime": "2018-06-25T13:38:28.316+0000",
"answerTime": "2018-06-25T13:38:25.000+0000",
"duration":10,
"fileDuration": 19.3,
"mccMnc": "21901",
"callbackData": "DLR callback data",
"dtmfCodes":"1",
"recordedAudioFileUrl":"/tts/3/files/bcfb828b-7df9-4e7b-8715-f34f5c61271a/38598111",
"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,
"mccMnc": "21901",
"callbackData": "DLR callback data",
"dtmfCodes":"1",
"recordedAudioFileUrl":"/tts/3/files/12db39c3-7822-4e72-a3ec-c87442c0ffc5/385981112",
"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>
<recordedAudioFileUrl>https://api.infobip.com/tts/3/files/bcfb828b-7df9-4e7b-8715-f34f5c61271a/38598111</recordedAudioFileUrl>
<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>
<recordedAudioFileUrl>https://api.infobip.com/tts/3/files/12db39c3-7822-4e72-a3ec-c87442c0ffc5/385981112</recordedAudioFileUrl>
<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>