List campaigns
curl --request GET \
--url https://my.cloudtalk.io/api/campaigns/index.json \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://my.cloudtalk.io/api/campaigns/index.json"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://my.cloudtalk.io/api/campaigns/index.json', 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://my.cloudtalk.io/api/campaigns/index.json",
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: Basic <encoded-value>"
],
]);
$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://my.cloudtalk.io/api/campaigns/index.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://my.cloudtalk.io/api/campaigns/index.json")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://my.cloudtalk.io/api/campaigns/index.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"responseData": {
"itemsCount": 3,
"pageCount": 1,
"pageNumber": 1,
"limit": 3,
"data": [
{
"Campaign": {
"id": "63",
"name": "Test Dialer",
"status": "inactive",
"has_schedule_date": false,
"answer_wait_time": "45",
"after_call_dialing_auto": false,
"after_call_time": "5",
"is_recording": false,
"is_predictive": false,
"attempts": "1",
"attempts_interval": "18"
},
"Button": [
{
"id": "252",
"title": "Sale",
"type": "successful_positive",
"color": "#2980b9",
"description": "Sold"
}
],
"ContactsTag": [
{
"id": "133",
"name": "dialer"
}
],
"Group": [
{
"id": "568",
"internal_name": "Agents"
}
],
"Agent": [
{
"id": "1075",
"fullname": "Jane Doe"
}
]
}
]
}
}Campaigns
List campaigns
Returns the account’s campaigns. Pass id to fetch a single campaign, or page through them with limit and page.
These are the campaigns of the original CloudTalk dialer. The newer sales dialer is a separate surface with its own host, authentication and response shape — see the Dialer endpoints.
GET
/
campaigns
/
index.json
List campaigns
curl --request GET \
--url https://my.cloudtalk.io/api/campaigns/index.json \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://my.cloudtalk.io/api/campaigns/index.json"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://my.cloudtalk.io/api/campaigns/index.json', 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://my.cloudtalk.io/api/campaigns/index.json",
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: Basic <encoded-value>"
],
]);
$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://my.cloudtalk.io/api/campaigns/index.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://my.cloudtalk.io/api/campaigns/index.json")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://my.cloudtalk.io/api/campaigns/index.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"responseData": {
"itemsCount": 3,
"pageCount": 1,
"pageNumber": 1,
"limit": 3,
"data": [
{
"Campaign": {
"id": "63",
"name": "Test Dialer",
"status": "inactive",
"has_schedule_date": false,
"answer_wait_time": "45",
"after_call_dialing_auto": false,
"after_call_time": "5",
"is_recording": false,
"is_predictive": false,
"attempts": "1",
"attempts_interval": "18"
},
"Button": [
{
"id": "252",
"title": "Sale",
"type": "successful_positive",
"color": "#2980b9",
"description": "Sold"
}
],
"ContactsTag": [
{
"id": "133",
"name": "dialer"
}
],
"Group": [
{
"id": "568",
"internal_name": "Agents"
}
],
"Agent": [
{
"id": "1075",
"fullname": "Jane Doe"
}
]
}
]
}
}Authorizations
HTTP Basic Authentication. Use your API Access Key ID as the username and your API Access Key Secret as the password. Generate keys in the CloudTalk Dashboard under Account -> Settings -> API Keys (https://dashboard.cloudtalk.io/menu/account/settings/API-keys).
Query Parameters
Filter by campaign ID
Max. number of items in response data.
Required range:
1 <= x <= 1000Number of page to return.
Required range:
x >= 1Response
200 - application/json
Contacts data
Show child attributes
Show child attributes
⌘I