Get Analytics
Retrieves analytics data for a specific inbound campaign within a given date range.
curl --request POST \
--url https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics"
payload = {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'})
};
fetch('https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '2023-11-07T05:31:56Z',
'to' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics"
payload := strings.NewReader("{\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"callsStatusOverview": {
"totalCalls": 123,
"totalLeads": 123,
"needRetry": 123,
"wrongCountryCode": 123,
"needFollowUp": 123,
"voiceMailLeft": 123,
"successful": 123,
"unsuccessful": 123,
"wrongNumber": 123,
"completed": 123,
"unreachable": 123,
"answeredCalls": 123,
"error": 123
},
"callsSentimentOverview": {
"negative": 123,
"slightlyNegative": 123,
"neutral": 123,
"slightlyPositive": 123,
"positive": 123
},
"callsStatusTimeLine": [
{
"totalCalls": 123,
"totalLeads": 123,
"needRetry": 123,
"wrongCountryCode": 123,
"needFollowUp": 123,
"voiceMailLeft": 123,
"successful": 123,
"unsuccessful": 123,
"wrongNumber": 123,
"completed": 123,
"unreachable": 123,
"answeredCalls": 123,
"error": 123,
"date": "2023-11-07T05:31:56Z"
}
],
"callsAverageTimeLine": [
{
"date": "2023-11-07T05:31:56Z",
"averageCallDuration": 123
}
],
"callsCostTimeLine": [
{
"date": "2023-11-07T05:31:56Z",
"totalPrice": 123,
"averageCostPerCall": 123
}
],
"callsSuccessRateTimeLine": [
{
"date": "2023-11-07T05:31:56Z",
"successRatePercentage": 123
}
],
"callLabelCount": [
{
"id": "<string>",
"name": "<string>",
"color": "<string>",
"count": 123
}
],
"callEventsCounts": {
"takeMessageCount": 123,
"smsSentCount": 123,
"callTransferredCount": 123,
"calendarBookedCount": 123,
"emailSentCount": 123
},
"callsByHourDayOfWeeks": [
{
"hourOfDay": 123,
"dayOfWeek": 123,
"count": 123
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}Authorizations
Specify the authorization token.
For more information, check out the Authorization Guide.
Path Parameters
The unique identifier of the inbound campaign.
Body
The object containing the start and end dates for the analytics query.
The maximum allowed range between the start and end date is 90 days.
Response
Returns an object containing the analytics data for the specified outbound campaign.
Represents the analytics data for an inbound campaign.
Overview of call statuses (e.g. success, failed, no answer).
Show child attributes
Show child attributes
Overview of sentiment analysis results for the client during calls.
Show child attributes
Show child attributes
Timeline showing the distribution of call statuses over time.
Show child attributes
Show child attributes
Timeline showing average call durations over time.
Show child attributes
Show child attributes
Timeline showing call costs over time.
Show child attributes
Show child attributes
Timeline showing success rate trends over time.
Show child attributes
Show child attributes
Count of labels applied to calls.
Show child attributes
Show child attributes
Summary of events that occurred during calls.
Show child attributes
Show child attributes
Breakdown of calls by hour and day of the week.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics"
payload = {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'})
};
fetch('https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '2023-11-07T05:31:56Z',
'to' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics"
payload := strings.NewReader("{\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nlpearl.ai/v1/Inbound/{inboundId}/Analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"callsStatusOverview": {
"totalCalls": 123,
"totalLeads": 123,
"needRetry": 123,
"wrongCountryCode": 123,
"needFollowUp": 123,
"voiceMailLeft": 123,
"successful": 123,
"unsuccessful": 123,
"wrongNumber": 123,
"completed": 123,
"unreachable": 123,
"answeredCalls": 123,
"error": 123
},
"callsSentimentOverview": {
"negative": 123,
"slightlyNegative": 123,
"neutral": 123,
"slightlyPositive": 123,
"positive": 123
},
"callsStatusTimeLine": [
{
"totalCalls": 123,
"totalLeads": 123,
"needRetry": 123,
"wrongCountryCode": 123,
"needFollowUp": 123,
"voiceMailLeft": 123,
"successful": 123,
"unsuccessful": 123,
"wrongNumber": 123,
"completed": 123,
"unreachable": 123,
"answeredCalls": 123,
"error": 123,
"date": "2023-11-07T05:31:56Z"
}
],
"callsAverageTimeLine": [
{
"date": "2023-11-07T05:31:56Z",
"averageCallDuration": 123
}
],
"callsCostTimeLine": [
{
"date": "2023-11-07T05:31:56Z",
"totalPrice": 123,
"averageCostPerCall": 123
}
],
"callsSuccessRateTimeLine": [
{
"date": "2023-11-07T05:31:56Z",
"successRatePercentage": 123
}
],
"callLabelCount": [
{
"id": "<string>",
"name": "<string>",
"color": "<string>",
"count": 123
}
],
"callEventsCounts": {
"takeMessageCount": 123,
"smsSentCount": 123,
"callTransferredCount": 123,
"calendarBookedCount": 123,
"emailSentCount": 123
},
"callsByHourDayOfWeeks": [
{
"hourOfDay": 123,
"dayOfWeek": 123,
"count": 123
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}
