Campaigns
Contact counts
How many of a campaign’s contacts are in each status: pending, calling, completed, failed, waiting for a retry, cancelled.
GET
/
v2
/
campaign
/
{id}
/
stats
Contact counts
curl --request GET \
--url https://api.verbeo.ai/v2/campaign/{id}/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v2/campaign/{id}/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.verbeo.ai/v2/campaign/{id}/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.verbeo.ai/v2/campaign/{id}/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.verbeo.ai/v2/campaign/{id}/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.verbeo.ai/v2/campaign/{id}/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v2/campaign/{id}/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_bodyReturns how many of the campaign’s contacts are in each status. Every status is in the answer, with
The statuses are those of List contacts.
And the errors every route can give.
0 where there are none. For the campaign’s own counters and status, read Get campaign.
Who may call it: any API key of the workspace; in the dashboard, any member.
Path
Request
curl "https://api.verbeo.ai/v2/campaign/0175091d-2c3b-4aef-8c45-dbbe24f7b3ff/stats" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
200 OK.
{
"success": true,
"data": {
"pending": 48660,
"calling": 12,
"completed": 1012,
"failed": 238,
"retry_scheduled": 76,
"cancelled": 0
}
}
Errors
| Code | Status | When |
|---|---|---|
NOT_FOUND | 404 | Campaign not found. |
VALIDATION_FAILED | 422 | id is not a UUID: must be a valid uuid. |
Was this page helpful?
⌘I
Contact counts
curl --request GET \
--url https://api.verbeo.ai/v2/campaign/{id}/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v2/campaign/{id}/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.verbeo.ai/v2/campaign/{id}/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.verbeo.ai/v2/campaign/{id}/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.verbeo.ai/v2/campaign/{id}/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.verbeo.ai/v2/campaign/{id}/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v2/campaign/{id}/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