OMNI reports
This method allows you to get one time delivery reports for messages sent using OMNI scenarios.
Resource
https://api.infobip.com/omni/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 | int | Maximal number of messages in returned reports. Default value is 50 and maximal value is 1000. |
| channel | string | Channel that was used for message delivering. Possible values are: SMS, VOICE, VIBER, WHATSAPP, PUSH, EMAIL. |
Request Example
GET /omni/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",
"messageCount":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
},
"channel": "SMS"
}
]
}
Response format
If successful, the response header HTTP status code will be 200 OK and delivery reports will be returned.
If you try to get delivery reports without authorization, you will get a response with the HTTP status code 401 Unauthorized.
OmniReportsResponse
| Parameter | Type | Description |
|---|---|---|
| results | OmniReport | Collection of reports, one per every message. |
OmniReport
| Parameter | Type | Description |
|---|---|---|
| bulkId | String | The ID that uniquely identifies the request. |
| messageId | String | The ID that uniquely identifies the message sent. |
| channel | String | Channel that was used for message delivering. Possible values are: SMS, VOICE, VIBER, PUSH, EMAIL. |
| to | String | The message destination address. |
| sentAt | Date | Tells when the message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. |
| doneAt | Date | Tells when the message was finished processing by Infobip (ie. delivered to destination, delivered to destination network, etc.). |
| messageCount | int | The number of sent message segments. |
| mccMnc | String | Mobile country and network codes. |
| price | Price | Sent 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 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. |
| 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. |
Additional examples
Getting reports without any query parameter
Request:
GET /omni/1/reports HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /omni/1/reports HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xmlcurl -X GET
-H 'Accept: application/json'
-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
https://api.infobip.com/omni/1/reports<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.infobip.com/omni/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_POSTFIELDS => "",
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/omni/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_bodyimport http.client
conn = http.client.HTTPSConnection("api.infobip.com")
headers = {
'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'accept': "application/json"
}
conn.request("GET", "/omni/1/reports", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))HttpResponse<String> response = Unirest.get("https://api.infobip.com/omni/1/reports")
.header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("accept", "application/json")
.asString();var client = new RestClient("https://api.infobip.com/omni/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/omni/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":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
"messageId":"07e03aae-fabc-44ad-b1ce-222e14094d70",
"to":"41793026727",
"messageCount": 1,
"sentAt":"2015-02-23T17:41:11.833+0100",
"doneAt":"2015-02-23T17:41:11.843+0100",
"mccMnc":"22801",
"price":{
"pricePerMessage":0.0104,
"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
},
"channel": "VIBER"
},
{
"bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
"messageId":"1f21d8d7-f306-4f53-9f6e-eddfce9849ea",
"to":"41793026727",
"sentAt":"2015-02-23T17:40:31.773+0100",
"doneAt":"2015-02-23T17:40:31.787+0100",
"messageCount":1,
"mccMnc":"22801",
"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
},
"channel": "SMS"
}
]
}
<?xml version="1.0" encoding="UTF-8"?>
<omniReportsResponse>
<results>
<result>
<bulkId>7944c32d-bf77-4f41-a752-c3aa89027adc</bulkId>
<messageId>f97d3b99-fab2-468e-8acf-c8c8792b8ce6</messageId>
<channel>VIBER</channel>
<to>41793026727</to>
<sentAt>2015-02-23T17:41:18.020+0100</sentAt>
<doneAt>2015-02-23T17:41:18.027+0100</doneAt>
<messageCount>1</messageCount>
<mccmnc>22801</mccmnc>
<price>
<pricePerMessage>0.0104</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>bafdeb3d-719b-4cce-8762-54d47b40f3c5</bulkId>
<messageId>07e03aae-fabc-44ad-b1ce-222e14094d70</messageId>
<channel>SMS</channel>
<to>41793026727</to>
<sentAt>2015-02-23T17:41:11.833+0100</sentAt>
<doneAt>2015-02-23T17:41:11.843+0100</doneAt>
<messageCount>1</messageCount>
<mccmnc>22801</mccmnc>
<price>
<pricePerMessage>0.0100</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>
</omniReportsResponse>Getting reports with channel as filter
This request will return messages sent over the specified omni PUSH channel.
Request:
GET /omni/1/reports?channel=PUSH HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /omni/1/reports?channel=PUSH HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xmlcurl -X GET
-H 'Accept: application/json'
-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
https://api.infobip.com/omni/1/reports?channel=PUSH<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.infobip.com/omni/1/reports?channel=PUSH",
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=="
),
));
$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/omni/1/reports?channel=PUSH")
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_bodyimport http.client
conn = http.client.HTTPSConnection("api.infobip.com")
headers = {
'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'accept': "application/json"
}
conn.request("GET", "/omni/1/reports?channel=PUSH", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))HttpResponse<String> response = Unirest.get("https://api.infobip.com/omni/1/reports?channel=PUSH")
.header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("accept", "application/json")
.asString();var client = new RestClient("https://api.infobip.com/omni/1/reports?channel=PUSH");
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/omni/1/reports?channel=PUSH");
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":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
"messageId":"07e03aae-fabc-44ad-b1ce-222e14094d70",
"to":"41793026727",
"sentAt":"2015-02-23T17:41:11.833+0100",
"doneAt":"2015-02-23T17:41:11.843+0100",
"messageCount":1,
"mccMnc":"22801",
"price":{
"pricePerMessage":0,
"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
},
"channel": "PUSH"
},
{
"bulkId":"1dece649-6c8f-404e-8c6e-c7e073be509a",
"messageId":"faa48fe6-fe2c-4f36-a43b-a070e2906ecb",
"to":"41793026727",
"sentAt":"2015-02-23T16:22:37.413+0100",
"doneAt":"2015-02-23T16:22:37.437+0100",
"messageCount":1,
"mccMnc":"22801",
"price":{
"pricePerMessage":0,
"currency":"EUR"
},
"status":{
"groupId":2,
"groupName":"UNDELIVERABLE",
"id":9,
"name":"UNDELIVERABLE_NOT_DELIVERED",
"description":"Message sent not delivered"
},
"error":{
"groupId":0,
"groupName":"OK",
"id":0,
"name":"NO_ERROR",
"description":"No Error",
"permanent":false
},
"channel": "PUSH"
}
]
}
<?xml version="1.0" encoding="UTF-8"?>
<omniReportsResponse>
<results>
<result>
<bulkId>bafdeb3d-719b-4cce-8762-54d47b40f3c5</bulkId>
<messageId>07e03aae-fabc-44ad-b1ce-222e14094d70</messageId>
<channel>PUSH</channel>
<to>41793026727</to>
<sentAt>2015-02-23T17:41:11.833+0100</sentAt>
<doneAt>2015-02-23T17:41:11.843+0100</doneAt>
<messageCount>1</messageCount>
<mccmnc>22801</mccmnc>
<price>
<pricePerMessage>0</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>1dece649-6c8f-404e-8c6e-c7e073be509a</bulkId>
<messageId>faa48fe6-fe2c-4f36-a43b-a070e2906ecb</messageId>
<channel>PUSH</channel>
<to>41793026727</to>
<sentAt>2015-02-23T16:22:37.413+0100</sentAt>
<doneAt>2015-02-23T16:22:37.437+0100</doneAt>
<messageCount>1</messageCount>
<mccmnc>22801</mccmnc>
<price>
<pricePerMessage>0</pricePerMessage>
<currency>EUR</currency>
</price>
<status>
<groupId>2</groupId>
<groupName>UNDELIVERABLE</groupName>
<id>9</id>
<name>UNDELIVERABLE_NOT_DELIVERED</name>
<description>Message sent not delivered</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>
</omniReportsResponse>