Call Stats
curl --request GET \
--url https://api.talqing.com/v1/calls/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.talqing.com/v1/calls/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.talqing.com/v1/calls/stats', 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.talqing.com/v1/calls/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.talqing.com/v1/calls/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.talqing.com/v1/calls/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.talqing.com/v1/calls/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"avg_cost_per_call": 123,
"end": "2023-11-07T05:31:56Z",
"judged_calls": 0,
"priced_calls": 123,
"start": "2023-11-07T05:31:56Z",
"successful_calls": 0,
"total_calls": 123,
"total_minutes": 123,
"total_spend": 123
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}calls
Call Stats
Totals for a window: call count, minutes, spend and average cost.
Spend and avg_cost_per_call count only priced calls (priced_calls), so
a call still being priced does not drag the average down. The window
defaults to the last 30 days.
GET
/
v1
/
calls
/
stats
Call Stats
curl --request GET \
--url https://api.talqing.com/v1/calls/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.talqing.com/v1/calls/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.talqing.com/v1/calls/stats', 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.talqing.com/v1/calls/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.talqing.com/v1/calls/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.talqing.com/v1/calls/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.talqing.com/v1/calls/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"avg_cost_per_call": 123,
"end": "2023-11-07T05:31:56Z",
"judged_calls": 0,
"priced_calls": 123,
"start": "2023-11-07T05:31:56Z",
"successful_calls": 0,
"total_calls": 123,
"total_minutes": 123,
"total_spend": 123
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}Authorizations
BearerAuthSessionCookie
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
window start (default: 30d ago)
window end (default: now)
Response
Successful Response
Range-wide totals for the calls page summary cards.
total_calls counts every matching voice/video session. Spend and
avg_cost_per_call use only priced sessions (billing_status = 'computed') so pending/unpriceable rows do not understate the average.