Get Campaign Progress
curl --request GET \
--url http://localhost:8000/api/v1/campaign/{campaign_id}/progressimport requests
url = "http://localhost:8000/api/v1/campaign/{campaign_id}/progress"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:8000/api/v1/campaign/{campaign_id}/progress', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/campaign/{campaign_id}/progress",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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 := "http://localhost:8000/api/v1/campaign/{campaign_id}/progress"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8000/api/v1/campaign/{campaign_id}/progress")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/campaign/{campaign_id}/progress")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"campaign_id": 123,
"state": "<string>",
"total_rows": 123,
"processed_rows": 123,
"failed_calls": 123,
"progress_percentage": 123,
"source_sync": {},
"rate_limit": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Кампании
Прогресс кампании
Получить текущий прогресс кампании
GET
/
api
/
v1
/
campaign
/
{campaign_id}
/
progress
Get Campaign Progress
curl --request GET \
--url http://localhost:8000/api/v1/campaign/{campaign_id}/progressimport requests
url = "http://localhost:8000/api/v1/campaign/{campaign_id}/progress"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:8000/api/v1/campaign/{campaign_id}/progress', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/campaign/{campaign_id}/progress",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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 := "http://localhost:8000/api/v1/campaign/{campaign_id}/progress"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8000/api/v1/campaign/{campaign_id}/progress")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/campaign/{campaign_id}/progress")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"campaign_id": 123,
"state": "<string>",
"total_rows": 123,
"processed_rows": 123,
"failed_calls": 123,
"progress_percentage": 123,
"source_sync": {},
"rate_limit": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Возвращает снимок в реальном времени того, сколько контактов уже обработано.
| Поле | Описание |
|---|---|
total | Общее количество контактов в кампании |
processed | Контакты, по которым была предпринята хотя бы одна попытка |
completed | Контакты с успешным результатом звонка |
failed | Контакты, исчерпавшие все попытки без успеха |
pending | Контакты, по которым попытки ещё не предпринимались |
completion_percentage | processed / total × 100 |
Path Parameters
Response
Successful Response
⌘I