Getting Outbound IVR logs

This method allows you to get logs for sent Outbound IVR.

Resource

https://api.infobip.com/tts/3/logs

Parameters

Property name Type Description
from string Sender ID that can be numeric.
to string The IVR destination number.
bulkId string The ID which uniquely identifies the request.
messageId string The ID that uniquely identifies the message sent.
generalStatus string Sent voice IVR status group. Indicates whether the IVR has been successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status.
sentSince datetime Lower the limit on the date and time of voice IVR sending.
sentUntil datetime The upper limit on the date and time of voice IVR sending.
limit int Maximal number of messages in the returned logs. Default value is 50.
mcc string Mobile country code.
mnc string Mobile network code.

Request Example

					GET /tts/3/logs HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
					
				
					curl -X GET \
  'https://{base_url}/tts/3/logs' \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
					
				
					<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://{base_url}/tts/3/logs",
  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://{base_url}/tts/3/logs")

http = Net::HTTP.new(url.host, url.port)

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.HTTPConnection("{base_url}")

headers = {
    'Authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    'Accept': "application/json"
    }

conn.request("GET", "tts,3,logs", headers=headers)

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

print(data.decode("utf-8"))
					
				
					HttpResponse<String> response = Unirest.get("https://{base_url}/tts/3/logs")
  .header("Authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
  .header("Accept", "application/json")
  .asString();
					
				
					var client = new RestClient("https://{base_url}/tts/3/logs");
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 === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://{base_url}/tts/3/logs");
xhr.setRequestHeader("Authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("Accept", "application/json");

xhr.send(data);
					
				

Response

					{  
   "results":[  
      {  
         "bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
         "messageId":"1f21d8d7-f306-4f53-9f6e-eddfce9849ea",
         "to":"41793026727",
         "from":"41793026700",
         "text":"Test voice message.",
         "sentAt":"2015-02-23T17:40:31.773+0100",
         "doneAt":"2015-02-23T17:40:31.787+0100",
         "duration":10,
         "mccmnc":"22801",
         "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": 5003,
            "name": "EC_VOICE_NO_ANSWER",
            "description": "User was notified, but did not answer call",
            "permanent": true
         }
      }
   ]
}
					
				

Important:

Voice logs are only available for the last 48 hours!

Response format

If successful, the response header HTTP status code will be 200 OK and the message logs will be returned.

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

Voice Logs Response

Parameter Type Description
results VoiceLog Collection of logs.

Voice Log

Parameter Type Description
bulkId String The unique ID that identifies the request.
messageId String The unique ID that identifies the message sent.
to String The IVR destination address.
from String Sender ID (can be numeric).
sentAt Date Reports when the IVR was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ.
doneAt Date Reports when the IVR 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.
price Price Sent IVR price.
status Status Indicates whether the IVR has been successfully sent, not sent, delivered, not delivered, waiting for delivery, or other status.
error Error Indicates whether the error occurred during the query execution.

Price

Parameter Type Description
pricePerMessage BigDecimal Price per one second of IVR.
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.

Additional examples

Getting logs without any query parameter

By default this request will return the last 50 message logs from last 48 hours.

Request:

GET /tts/3/logs HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /tts/3/logs HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml
curl -X GET 
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" 
-H "Content-Type: application/json" 
-H "Accept: application/json" 
"http://api.infobip.com/tts/3/logs"
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.infobip.com/tts/3/logs",
  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/logs")

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_body
import 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/logs", payload, headers)

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

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("http://api.infobip.com/tts/3/logs")
  .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .asString();
var client = new RestClient("http://api.infobip.com/tts/3/logs");
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/logs");
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":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
         "messageId":"07e03aae-fabc-44ad-b1ce-222e14094d70",
         "to":"41793026727",
         "from":"41793026700",
         "text":"Test voice message 1.",
         "sentAt":"2015-02-23T17:41:11.833+0100",
         "doneAt":"2015-02-23T17:41:11.843+0100",
         "duration":10,
         "mccmnc":"22801",
         "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": 5003,
            "name": "EC_VOICE_NO_ANSWER",
            "description": "User was notified, but did not answer call",
            "permanent": true
         }
      },
      {  
         "bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
         "messageId":"1f21d8d7-f306-4f53-9f6e-eddfce9849ea",
         "to":"41793026727",
         "from":"41793026700",
         "text":"Test voice message 2.",
         "sentAt":"2015-02-23T17:40:31.773+0100",
         "doneAt":"2015-02-23T17:40:31.787+0100",
         "duration":10,
         "mccmnc":"22801",
         "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": 5003,
            "name": "EC_VOICE_NO_ANSWER",
            "description": "User was notified, but did not answer call",
            "permanent": true
         }
            }
   ]
}
HTTP/1.1 200 OK
Content-Type: application/xml

<smsLogsResponse>
    <results>
        <result>
            <bulkId>7944c32d-bf77-4f41-a752-c3aa89027adc</bulkId>
            <messageId>f97d3b99-fab2-468e-8acf-c8c8792b8ce6</messageId>
            <to>41793026727</to>
            <from>InfoSMS</from>
            <text>Test SMS.</text>
            <sentAt>2015-02-23T17:41:18.020+0100</sentAt>
            <doneAt>2015-02-23T17:41:18.027+0100</doneAt>
            <duration>1</duration>
            <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>5003</id>
                <name>EC_VOICE_NO_ANSWER</name>
                <description>User was notified, but did not answer call</description>
                <permanent>true</permanent>
            </error>
        </result>
        <result>
            <bulkId>bafdeb3d-719b-4cce-8762-54d47b40f3c5</bulkId>
            <messageId>07e03aae-fabc-44ad-b1ce-222e14094d70</messageId>
            <to>41793026727</to>
            <from>InfoSMS</from>
            <text>Test SMS.</text>
            <sentAt>2015-02-23T17:41:11.833+0100</sentAt>
            <doneAt>2015-02-23T17:41:11.843+0100</doneAt>
            <duration>1</duration>
            <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>5003</id>
                <name>EC_VOICE_NO_ANSWER</name>
                <description>User was notified, but did not answer call</description>
                <permanent>true</permanent>
            </error>
        </result>
    </results>
</smsLogsResponse>

Getting logs with from, to and limit as filters

This request will filter final messages according to the rule - of all messages sent from from, return last limit messages with destinations to.

Request:

GET /tts/3/logs?from=41793026700&to=41793026727&limit=1 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /tts/3/logs?from=41793026700&to=41793026727&limit=1 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml
curl -X GET \
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
"http://api.infobip.com/tts/3/logs?from=41793026700&to=41793026727&limit=1"
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.infobip.com/tts/3/logs?from=41793026700&to=41793026727&limit=1",
  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;
}
import 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/logs?from=41793026700&to=41793026727&limit=1", payload, headers)

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

print(data.decode("utf-8"))
import 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/logs?from=41793026700&to=41793026727&limit=1", payload, headers)

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

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("http://api.infobip.com/tts/3/logs?from=41793026700&to=41793026727&limit=1")
  .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .asString();
var client = new RestClient("http://api.infobip.com/tts/3/logs?from=41793026700&to=41793026727&limit=1");
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/logs?from=41793026700&to=41793026727&limit=1");
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":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
         "messageId":"07e03aae-fabc-44ad-b1ce-222e14094d70",
         "to":"41793026727",
         "from":"41793026700",
         "text":"Test voice message 1.",
         "sentAt":"2015-02-23T17:41:11.833+0100",
         "doneAt":"2015-02-23T17:41:11.843+0100",
         "duration":10,
         "mccmnc":"22801",
         "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": 5003,
            "name": "EC_VOICE_NO_ANSWER",
            "description": "User was notified, but did not answer call",
            "permanent": true
         }
      }
   ]
}
HTTP/1.1 200 OK
Content-Type: application/xml

<smsLogsResponse>
   <results>
      <result>
         <bulkId>82d1d36e-e4fb-4194-8b93-caeb053bd327</bulkId>
         <messageId>fc0cbfb8-7a72-40da-a76d-e2c2d9400835</messageId>
         <to>41793026727</to>
         <from>InfoSMS</from>
         <text>Test SMS.</text>
         <sentAt>2015-02-23T17:42:05.390+0100</sentAt>
         <doneAt>2015-02-23T17:42:05.390+0100</doneAt>
         <duration>1</duration>
         <mccmnc>22801</mccmnc>
         <price>
            <pricePerMessage>0.0000</pricePerMessage>
            <currency>EUR</currency>
         </price>
         <status>
            <groupId>5</groupId>
            <groupName>REJECTED</groupName>
            <id>6</id>
            <name>REJECTED_NETWORK</name>
            <description>Network is forbidden</description>
            <action>Contact account manager</action>
         </status>
         <error>
            <groupId>0</groupId>
            <groupName>OK</groupName>
            <id>5003</id>
                <name>EC_VOICE_NO_ANSWER</name>
                <description>User was notified, but did not answer call</description>
                <permanent>true</permanent>
         </error>
      </result>
   </results>
</smsLogsResponse>

Getting logs filtered by multiple bulkIds

This request will return messages that have bulkId among the specified bulkIds in the filter.

Request

GET /tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a,bafdeb3d-719b-4cce-8762-54d47b40f3c5 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a,bafdeb3d-719b-4cce-8762-54d47b40f3c5 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml
curl -X GET 
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" 
-H "Content-Type: application/json" 
-H "Accept: application/json" 
"http://api.infobip.com/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a,bafdeb3d-719b-4cce-8762-54d47b40f3c5"
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.infobip.com/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5",
  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/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5")

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_body
import 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/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5", payload, headers)

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

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("http://api.infobip.com/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5")
  .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .asString();
var client = new RestClient("http://api.infobip.com/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5");
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/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5");
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":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
         "messageId":"07e03aae-fabc-44ad-b1ce-222e14094d70",
         "to":"41793026727",
         "from":"41793026700",
         "text":"Test voice message 1.",
         "sentAt":"2015-02-23T17:41:11.833+0100",
         "doneAt":"2015-02-23T17:41:11.843+0100",
         "duration":10,
         "mccmnc":"22801",
         "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": 5003,
            "name": "EC_VOICE_NO_ANSWER",
            "description": "User was notified, but did not answer call",
            "permanent": true
         }
      },
      {  
         "bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
         "messageId":"1f21d8d7-f306-4f53-9f6e-eddfce9849ea",
         "to":"41793026727",
         "from":"41793026700",
         "text":"Test voice message 2.",
         "sentAt":"2015-02-23T17:40:31.773+0100",
         "doneAt":"2015-02-23T17:40:31.787+0100",
         "duration":10,
         "mccmnc":"22801",
         "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": 5003,
            "name": "EC_VOICE_NO_ANSWER",
            "description": "User was notified, but did not answer call",
            "permanent": true
         }
            }
   ]
}
HTTP/1.1 200 OK
Content-Type: application/xml

<smsLogsResponse>
   <results>
      <result>
         <bulkId>bafdeb3d-719b-4cce-8762-54d47b40f3c5</bulkId>
         <messageId>07e03aae-fabc-44ad-b1ce-222e14094d70</messageId>
         <to>41793026727</to>
         <from>InfoSMS</from>
         <text>Test SMS.</text>
         <sentAt>2015-02-23T17:41:11.833+0100</sentAt>
         <doneAt>2015-02-23T17:41:11.843+0100</doneAt>
         <duration>1</duration>
         <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>5003</id>
                <name>EC_VOICE_NO_ANSWER</name>
                <description>User was notified, but did not answer call</description>
                <permanent>true</permanent>
         </error>
      </result>
      <result>
         <bulkId>1dece649-6c8f-404e-8c6e-c7e073be509a</bulkId>
         <messageId>faa48fe6-fe2c-4f36-a43b-a070e2906ecb</messageId>
         <to>41793026727</to>
         <from>InfoSMS</from>
         <text>Test SMS.</text>
         <sentAt>2015-02-23T16:22:37.413+0100</sentAt>
         <doneAt>2015-02-23T16:22:37.437+0100</doneAt>
         <duration>1</duration>
         <mccmnc>22801</mccmnc>
         <price>
            <pricePerMessage>0.0000</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>5003</id>
                <name>EC_VOICE_NO_ANSWER</name>
                <description>User was notified, but did not answer call</description>
                <permanent>true</permanent>
         </error>
      </result>
   </results>
</smsLogsResponse>

Getting logs filtered by date range and general status

This request will return messages with status that matches the generalStatus parameter (see Response codes) which are sent between sentSince and current time.

Request:

GET /tts/3/logs?sentSince=2015-02-22T17:42:05.390%2b01:00&generalStatus=DELIVERED HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /tts/3/logs?sentSince=2015-02-22T17:42:05.390%2b01:00&generalStatus=DELIVERED HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml
curl -X GET 
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" 
-H "Content-Type: application/json" 
-H "Accept: application/json" 
"http://api.infobip.com/tts/3/logs?sentSince=2015-02-22T17:42:05.390%252b01:00&generalStatus=DELIVERED"
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.infobip.com/tts/3/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED",
  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/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED")

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_body
import 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/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED", payload, headers)

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

print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.get("http://api.infobip.com/tts/3/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED")
  .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .asString();
var client = new RestClient("http://api.infobip.com/tts/3/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED");
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/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED");
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":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
         "messageId":"07e03aae-fabc-44ad-b1ce-222e14094d70",
         "to":"41793026727",
         "from":"41793026700",
         "text":"Test voice message 1.",
         "sentAt":"2015-02-23T17:41:11.833+0100",
         "doneAt":"2015-02-23T17:41:11.843+0100",
         "duration":10,
         "mccmnc":"22801",
         "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": 5003,
            "name": "EC_VOICE_NO_ANSWER",
            "description": "User was notified, but did not answer call",
            "permanent": true
         }
      }
   ]
}
HTTP/1.1 200 OK
Content-Type: application/xml

<smsLogsResponse>
   <results>
      <result>
         <bulkId>ce166d0e-bac7-4639-a094-52c406852afd</bulkId>
         <messageId>fdf71ada-3308-4cd1-9962-31f2b937a1d0</messageId>
         <to>41793026727</to>
         <from>InfoSMS</from>
         <text>Test SMS.</text>
         <sentAt>2015-02-24T10:34:56.463+0100</sentAt>
         <doneAt>2015-02-24T10:34:56.480+0100</doneAt>
         <duration>1</duration>
         <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>5003</id>
                <name>EC_VOICE_NO_ANSWER</name>
                <description>User was notified, but did not answer call</description>
                <permanent>true</permanent>
         </error>
      </result>
   </results>
</smsLogsResponse>