Get analytics namespace
curl --request POST \
--url https://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": {
"filterBag": [],
"filters": [],
"from": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"to": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}"
payload = { "query": {
"filterBag": [],
"filters": [],
"from": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"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({
query: {
filterBag: [],
filters: [],
from: '2023-11-07T05:31:56Z',
timezone: '<string>',
to: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}', 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://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}",
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([
'query' => [
'filterBag' => [
],
'filters' => [
],
'from' => '2023-11-07T05:31:56Z',
'timezone' => '<string>',
'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://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}"
payload := strings.NewReader("{\n \"query\": {\n \"filterBag\": [],\n \"filters\": [],\n \"from\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"to\": \"2023-11-07T05:31:56Z\"\n }\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://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": {\n \"filterBag\": [],\n \"filters\": [],\n \"from\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"to\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}")
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 \"query\": {\n \"filterBag\": [],\n \"filters\": [],\n \"from\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"to\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"analyticsData": "<unknown>"
}
}{
"errors": [
{
"error": "MissingTenantIDError",
"error_code": 1001,
"message": "tenantID is required.",
"statusCode": 400
}
]
}{
"errors": [
{
"error": "UnauthorizedError",
"error_code": 1003,
"message": "You are not authorized to perform this request.",
"statusCode": 401
}
]
}{
"errors": [
{
"error": "ForbiddenError",
"error_code": 1004,
"message": "You do not have access to this resource.",
"statusCode": 403
}
]
}{
"errors": [
{
"error": "UnknownError",
"error_code": 5999,
"message": "For some unknown reason your request has not succeeded.",
"statusCode": 500
}
]
}Analytics
Get analytics namespace
Queries a single analytics namespace (e.g. sessions, messages, credits) over a date range and set of filters, returning the response shape specific to that namespace.
POST
/
v1
/
tenants
/
{tenantID}
/
analytics
/
{namespace}
Get analytics namespace
curl --request POST \
--url https://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": {
"filterBag": [],
"filters": [],
"from": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"to": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}"
payload = { "query": {
"filterBag": [],
"filters": [],
"from": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"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({
query: {
filterBag: [],
filters: [],
from: '2023-11-07T05:31:56Z',
timezone: '<string>',
to: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}', 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://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}",
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([
'query' => [
'filterBag' => [
],
'filters' => [
],
'from' => '2023-11-07T05:31:56Z',
'timezone' => '<string>',
'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://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}"
payload := strings.NewReader("{\n \"query\": {\n \"filterBag\": [],\n \"filters\": [],\n \"from\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"to\": \"2023-11-07T05:31:56Z\"\n }\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://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": {\n \"filterBag\": [],\n \"filters\": [],\n \"from\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"to\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services-api.talqui.chat/v1/tenants/{tenantID}/analytics/{namespace}")
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 \"query\": {\n \"filterBag\": [],\n \"filters\": [],\n \"from\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"to\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"analyticsData": "<unknown>"
}
}{
"errors": [
{
"error": "MissingTenantIDError",
"error_code": 1001,
"message": "tenantID is required.",
"statusCode": 400
}
]
}{
"errors": [
{
"error": "UnauthorizedError",
"error_code": 1003,
"message": "You are not authorized to perform this request.",
"statusCode": 401
}
]
}{
"errors": [
{
"error": "ForbiddenError",
"error_code": 1004,
"message": "You do not have access to this resource.",
"statusCode": 403
}
]
}{
"errors": [
{
"error": "UnknownError",
"error_code": 5999,
"message": "For some unknown reason your request has not succeeded.",
"statusCode": 500
}
]
}Authorizations
Behalf of an Operator (default). A JWT issued by Talqui Core when an operator signs in, scoped to every tenant that operator belongs to. Send as Authorization: Bearer <jwt-token>.
Body
application/json
The analytics namespace being queried (also present in the URL).
Available options:
messages_outbound, sessions_initialized, sessions_created, sessions_responsiveness, contacts_created, operators_leaderboard, operator_sessions, session_motives, session_bypluginconnection, sessions_intensity, campaignmodels_usage, evaluation_automation_overview, evaluation_quality_distribution, evaluation_quality_reasons, evaluation_weekly_average_score, evaluation_quality_tiers, evaluation_top_procedures, credits_daily_balance, credits_consumption, credits_projection, credits_by_operation, credits_ledger, credits_ledger_grouped Query parameters for this namespace: date range, granularity and filters.
Show child attributes
Show child attributes
Response
Response for status 200.
Show child attributes
Show child attributes
⌘I