Campaigns
Replace the campaign settings
Replaces the settings when nobody saved since expectedVersion was read; otherwise refused with 409. Campaigns already created keep their policy. Needs a Full access key.
PUT
/
api
/
v2
/
campaign-settings
Replace the campaign settings
curl --request PUT \
--url https://app.cntillion.com/api/v2/campaign-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedVersion": 1,
"settings": {
"defaultPolicy": {
"timezone": "<string>",
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
],
"retries": {
"maxTotalCalls": 15,
"maxShortRetries": 14,
"maxCallbacks": 14,
"maxRedirects": 14,
"maxConsecutiveFailures": 15,
"retryDelaySeconds": 302400,
"rotateStepSeconds": 43200
},
"dataCollection": {
"callbacks": true,
"redirects": true,
"doNotCall": true,
"mappings": [
{
"field": "<string>",
"variable": "<string>"
}
]
},
"useRecipientTimezone": false,
"followUpContext": {
"callType": true,
"previousConversationId": true,
"previousSummary": true,
"previousTranscript": true
}
},
"whatsappVoice": {
"timezone": "<string>",
"useRecipientTimezone": true,
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
]
},
"agentOverrides": [
{
"agentId": "<string>",
"timezone": "<string>",
"useRecipientTimezone": true,
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
]
}
]
}
}
'import requests
url = "https://app.cntillion.com/api/v2/campaign-settings"
payload = {
"expectedVersion": 1,
"settings": {
"defaultPolicy": {
"timezone": "<string>",
"callingWindows": [
{
"weekdays": [3],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
],
"retries": {
"maxTotalCalls": 15,
"maxShortRetries": 14,
"maxCallbacks": 14,
"maxRedirects": 14,
"maxConsecutiveFailures": 15,
"retryDelaySeconds": 302400,
"rotateStepSeconds": 43200
},
"dataCollection": {
"callbacks": True,
"redirects": True,
"doNotCall": True,
"mappings": [
{
"field": "<string>",
"variable": "<string>"
}
]
},
"useRecipientTimezone": False,
"followUpContext": {
"callType": True,
"previousConversationId": True,
"previousSummary": True,
"previousTranscript": True
}
},
"whatsappVoice": {
"timezone": "<string>",
"useRecipientTimezone": True,
"callingWindows": [
{
"weekdays": [3],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
]
},
"agentOverrides": [
{
"agentId": "<string>",
"timezone": "<string>",
"useRecipientTimezone": True,
"callingWindows": [
{
"weekdays": [3],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
]
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedVersion: 1,
settings: {
defaultPolicy: {
timezone: '<string>',
callingWindows: [{weekdays: [3], intervals: [{start: '<string>', end: '<string>'}]}],
retries: {
maxTotalCalls: 15,
maxShortRetries: 14,
maxCallbacks: 14,
maxRedirects: 14,
maxConsecutiveFailures: 15,
retryDelaySeconds: 302400,
rotateStepSeconds: 43200
},
dataCollection: {
callbacks: true,
redirects: true,
doNotCall: true,
mappings: [{field: '<string>', variable: '<string>'}]
},
useRecipientTimezone: false,
followUpContext: {
callType: true,
previousConversationId: true,
previousSummary: true,
previousTranscript: true
}
},
whatsappVoice: {
timezone: '<string>',
useRecipientTimezone: true,
callingWindows: [{weekdays: [3], intervals: [{start: '<string>', end: '<string>'}]}]
},
agentOverrides: [
{
agentId: '<string>',
timezone: '<string>',
useRecipientTimezone: true,
callingWindows: [{weekdays: [3], intervals: [{start: '<string>', end: '<string>'}]}]
}
]
}
})
};
fetch('https://app.cntillion.com/api/v2/campaign-settings', 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://app.cntillion.com/api/v2/campaign-settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'expectedVersion' => 1,
'settings' => [
'defaultPolicy' => [
'timezone' => '<string>',
'callingWindows' => [
[
'weekdays' => [
3
],
'intervals' => [
[
'start' => '<string>',
'end' => '<string>'
]
]
]
],
'retries' => [
'maxTotalCalls' => 15,
'maxShortRetries' => 14,
'maxCallbacks' => 14,
'maxRedirects' => 14,
'maxConsecutiveFailures' => 15,
'retryDelaySeconds' => 302400,
'rotateStepSeconds' => 43200
],
'dataCollection' => [
'callbacks' => true,
'redirects' => true,
'doNotCall' => true,
'mappings' => [
[
'field' => '<string>',
'variable' => '<string>'
]
]
],
'useRecipientTimezone' => false,
'followUpContext' => [
'callType' => true,
'previousConversationId' => true,
'previousSummary' => true,
'previousTranscript' => true
]
],
'whatsappVoice' => [
'timezone' => '<string>',
'useRecipientTimezone' => true,
'callingWindows' => [
[
'weekdays' => [
3
],
'intervals' => [
[
'start' => '<string>',
'end' => '<string>'
]
]
]
]
],
'agentOverrides' => [
[
'agentId' => '<string>',
'timezone' => '<string>',
'useRecipientTimezone' => true,
'callingWindows' => [
[
'weekdays' => [
3
],
'intervals' => [
[
'start' => '<string>',
'end' => '<string>'
]
]
]
]
]
]
]
]),
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://app.cntillion.com/api/v2/campaign-settings"
payload := strings.NewReader("{\n \"expectedVersion\": 1,\n \"settings\": {\n \"defaultPolicy\": {\n \"timezone\": \"<string>\",\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ],\n \"retries\": {\n \"maxTotalCalls\": 15,\n \"maxShortRetries\": 14,\n \"maxCallbacks\": 14,\n \"maxRedirects\": 14,\n \"maxConsecutiveFailures\": 15,\n \"retryDelaySeconds\": 302400,\n \"rotateStepSeconds\": 43200\n },\n \"dataCollection\": {\n \"callbacks\": true,\n \"redirects\": true,\n \"doNotCall\": true,\n \"mappings\": [\n {\n \"field\": \"<string>\",\n \"variable\": \"<string>\"\n }\n ]\n },\n \"useRecipientTimezone\": false,\n \"followUpContext\": {\n \"callType\": true,\n \"previousConversationId\": true,\n \"previousSummary\": true,\n \"previousTranscript\": true\n }\n },\n \"whatsappVoice\": {\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"agentOverrides\": [\n {\n \"agentId\": \"<string>\",\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.cntillion.com/api/v2/campaign-settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expectedVersion\": 1,\n \"settings\": {\n \"defaultPolicy\": {\n \"timezone\": \"<string>\",\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ],\n \"retries\": {\n \"maxTotalCalls\": 15,\n \"maxShortRetries\": 14,\n \"maxCallbacks\": 14,\n \"maxRedirects\": 14,\n \"maxConsecutiveFailures\": 15,\n \"retryDelaySeconds\": 302400,\n \"rotateStepSeconds\": 43200\n },\n \"dataCollection\": {\n \"callbacks\": true,\n \"redirects\": true,\n \"doNotCall\": true,\n \"mappings\": [\n {\n \"field\": \"<string>\",\n \"variable\": \"<string>\"\n }\n ]\n },\n \"useRecipientTimezone\": false,\n \"followUpContext\": {\n \"callType\": true,\n \"previousConversationId\": true,\n \"previousSummary\": true,\n \"previousTranscript\": true\n }\n },\n \"whatsappVoice\": {\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"agentOverrides\": [\n {\n \"agentId\": \"<string>\",\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cntillion.com/api/v2/campaign-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedVersion\": 1,\n \"settings\": {\n \"defaultPolicy\": {\n \"timezone\": \"<string>\",\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ],\n \"retries\": {\n \"maxTotalCalls\": 15,\n \"maxShortRetries\": 14,\n \"maxCallbacks\": 14,\n \"maxRedirects\": 14,\n \"maxConsecutiveFailures\": 15,\n \"retryDelaySeconds\": 302400,\n \"rotateStepSeconds\": 43200\n },\n \"dataCollection\": {\n \"callbacks\": true,\n \"redirects\": true,\n \"doNotCall\": true,\n \"mappings\": [\n {\n \"field\": \"<string>\",\n \"variable\": \"<string>\"\n }\n ]\n },\n \"useRecipientTimezone\": false,\n \"followUpContext\": {\n \"callType\": true,\n \"previousConversationId\": true,\n \"previousSummary\": true,\n \"previousTranscript\": true\n }\n },\n \"whatsappVoice\": {\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"agentOverrides\": [\n {\n \"agentId\": \"<string>\",\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"version": 123,
"settings": {
"defaultPolicy": {
"timezone": "<string>",
"useRecipientTimezone": false,
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
],
"retries": {
"maxTotalCalls": 15,
"maxShortRetries": 14,
"maxCallbacks": 14,
"maxRedirects": 14,
"maxConsecutiveFailures": 15,
"retryDelaySeconds": 302400,
"intervalPlacement": "start",
"rotateStepSeconds": 43200
},
"dataCollection": {
"callbacks": true,
"redirects": true,
"doNotCall": true,
"mappings": [
{
"field": "<string>",
"variable": "<string>"
}
]
},
"followUpContext": {
"callType": true,
"previousConversationId": true,
"previousSummary": true,
"previousTranscript": true
}
},
"whatsappVoice": {
"timezone": "<string>",
"useRecipientTimezone": true,
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
],
"retries": {
"maxTotalCalls": 15,
"maxShortRetries": 14,
"maxCallbacks": 14,
"maxRedirects": 14,
"maxConsecutiveFailures": 15,
"retryDelaySeconds": 302400,
"intervalPlacement": "start",
"rotateStepSeconds": 43200
},
"dataCollection": {
"callbacks": true,
"redirects": true,
"doNotCall": true,
"mappings": [
{
"field": "<string>",
"variable": "<string>"
}
]
},
"followUpContext": {
"callType": true,
"previousConversationId": true,
"previousSummary": true,
"previousTranscript": true
}
},
"agentOverrides": [
{
"agentId": "<string>",
"timezone": "<string>",
"useRecipientTimezone": true,
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
],
"retries": {
"maxTotalCalls": 15,
"maxShortRetries": 14,
"maxCallbacks": 14,
"maxRedirects": 14,
"maxConsecutiveFailures": 15,
"retryDelaySeconds": 302400,
"intervalPlacement": "start",
"rotateStepSeconds": 43200
},
"dataCollection": {
"callbacks": true,
"redirects": true,
"doNotCall": true,
"mappings": [
{
"field": "<string>",
"variable": "<string>"
}
]
},
"followUpContext": {
"callType": true,
"previousConversationId": true,
"previousSummary": true,
"previousTranscript": true
}
}
]
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
workspaceApiKeyworkspaceApiKeyHeader
Body
application/json
⌘I
Replace the campaign settings
curl --request PUT \
--url https://app.cntillion.com/api/v2/campaign-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedVersion": 1,
"settings": {
"defaultPolicy": {
"timezone": "<string>",
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
],
"retries": {
"maxTotalCalls": 15,
"maxShortRetries": 14,
"maxCallbacks": 14,
"maxRedirects": 14,
"maxConsecutiveFailures": 15,
"retryDelaySeconds": 302400,
"rotateStepSeconds": 43200
},
"dataCollection": {
"callbacks": true,
"redirects": true,
"doNotCall": true,
"mappings": [
{
"field": "<string>",
"variable": "<string>"
}
]
},
"useRecipientTimezone": false,
"followUpContext": {
"callType": true,
"previousConversationId": true,
"previousSummary": true,
"previousTranscript": true
}
},
"whatsappVoice": {
"timezone": "<string>",
"useRecipientTimezone": true,
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
]
},
"agentOverrides": [
{
"agentId": "<string>",
"timezone": "<string>",
"useRecipientTimezone": true,
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
]
}
]
}
}
'import requests
url = "https://app.cntillion.com/api/v2/campaign-settings"
payload = {
"expectedVersion": 1,
"settings": {
"defaultPolicy": {
"timezone": "<string>",
"callingWindows": [
{
"weekdays": [3],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
],
"retries": {
"maxTotalCalls": 15,
"maxShortRetries": 14,
"maxCallbacks": 14,
"maxRedirects": 14,
"maxConsecutiveFailures": 15,
"retryDelaySeconds": 302400,
"rotateStepSeconds": 43200
},
"dataCollection": {
"callbacks": True,
"redirects": True,
"doNotCall": True,
"mappings": [
{
"field": "<string>",
"variable": "<string>"
}
]
},
"useRecipientTimezone": False,
"followUpContext": {
"callType": True,
"previousConversationId": True,
"previousSummary": True,
"previousTranscript": True
}
},
"whatsappVoice": {
"timezone": "<string>",
"useRecipientTimezone": True,
"callingWindows": [
{
"weekdays": [3],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
]
},
"agentOverrides": [
{
"agentId": "<string>",
"timezone": "<string>",
"useRecipientTimezone": True,
"callingWindows": [
{
"weekdays": [3],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
]
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedVersion: 1,
settings: {
defaultPolicy: {
timezone: '<string>',
callingWindows: [{weekdays: [3], intervals: [{start: '<string>', end: '<string>'}]}],
retries: {
maxTotalCalls: 15,
maxShortRetries: 14,
maxCallbacks: 14,
maxRedirects: 14,
maxConsecutiveFailures: 15,
retryDelaySeconds: 302400,
rotateStepSeconds: 43200
},
dataCollection: {
callbacks: true,
redirects: true,
doNotCall: true,
mappings: [{field: '<string>', variable: '<string>'}]
},
useRecipientTimezone: false,
followUpContext: {
callType: true,
previousConversationId: true,
previousSummary: true,
previousTranscript: true
}
},
whatsappVoice: {
timezone: '<string>',
useRecipientTimezone: true,
callingWindows: [{weekdays: [3], intervals: [{start: '<string>', end: '<string>'}]}]
},
agentOverrides: [
{
agentId: '<string>',
timezone: '<string>',
useRecipientTimezone: true,
callingWindows: [{weekdays: [3], intervals: [{start: '<string>', end: '<string>'}]}]
}
]
}
})
};
fetch('https://app.cntillion.com/api/v2/campaign-settings', 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://app.cntillion.com/api/v2/campaign-settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'expectedVersion' => 1,
'settings' => [
'defaultPolicy' => [
'timezone' => '<string>',
'callingWindows' => [
[
'weekdays' => [
3
],
'intervals' => [
[
'start' => '<string>',
'end' => '<string>'
]
]
]
],
'retries' => [
'maxTotalCalls' => 15,
'maxShortRetries' => 14,
'maxCallbacks' => 14,
'maxRedirects' => 14,
'maxConsecutiveFailures' => 15,
'retryDelaySeconds' => 302400,
'rotateStepSeconds' => 43200
],
'dataCollection' => [
'callbacks' => true,
'redirects' => true,
'doNotCall' => true,
'mappings' => [
[
'field' => '<string>',
'variable' => '<string>'
]
]
],
'useRecipientTimezone' => false,
'followUpContext' => [
'callType' => true,
'previousConversationId' => true,
'previousSummary' => true,
'previousTranscript' => true
]
],
'whatsappVoice' => [
'timezone' => '<string>',
'useRecipientTimezone' => true,
'callingWindows' => [
[
'weekdays' => [
3
],
'intervals' => [
[
'start' => '<string>',
'end' => '<string>'
]
]
]
]
],
'agentOverrides' => [
[
'agentId' => '<string>',
'timezone' => '<string>',
'useRecipientTimezone' => true,
'callingWindows' => [
[
'weekdays' => [
3
],
'intervals' => [
[
'start' => '<string>',
'end' => '<string>'
]
]
]
]
]
]
]
]),
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://app.cntillion.com/api/v2/campaign-settings"
payload := strings.NewReader("{\n \"expectedVersion\": 1,\n \"settings\": {\n \"defaultPolicy\": {\n \"timezone\": \"<string>\",\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ],\n \"retries\": {\n \"maxTotalCalls\": 15,\n \"maxShortRetries\": 14,\n \"maxCallbacks\": 14,\n \"maxRedirects\": 14,\n \"maxConsecutiveFailures\": 15,\n \"retryDelaySeconds\": 302400,\n \"rotateStepSeconds\": 43200\n },\n \"dataCollection\": {\n \"callbacks\": true,\n \"redirects\": true,\n \"doNotCall\": true,\n \"mappings\": [\n {\n \"field\": \"<string>\",\n \"variable\": \"<string>\"\n }\n ]\n },\n \"useRecipientTimezone\": false,\n \"followUpContext\": {\n \"callType\": true,\n \"previousConversationId\": true,\n \"previousSummary\": true,\n \"previousTranscript\": true\n }\n },\n \"whatsappVoice\": {\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"agentOverrides\": [\n {\n \"agentId\": \"<string>\",\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.cntillion.com/api/v2/campaign-settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expectedVersion\": 1,\n \"settings\": {\n \"defaultPolicy\": {\n \"timezone\": \"<string>\",\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ],\n \"retries\": {\n \"maxTotalCalls\": 15,\n \"maxShortRetries\": 14,\n \"maxCallbacks\": 14,\n \"maxRedirects\": 14,\n \"maxConsecutiveFailures\": 15,\n \"retryDelaySeconds\": 302400,\n \"rotateStepSeconds\": 43200\n },\n \"dataCollection\": {\n \"callbacks\": true,\n \"redirects\": true,\n \"doNotCall\": true,\n \"mappings\": [\n {\n \"field\": \"<string>\",\n \"variable\": \"<string>\"\n }\n ]\n },\n \"useRecipientTimezone\": false,\n \"followUpContext\": {\n \"callType\": true,\n \"previousConversationId\": true,\n \"previousSummary\": true,\n \"previousTranscript\": true\n }\n },\n \"whatsappVoice\": {\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"agentOverrides\": [\n {\n \"agentId\": \"<string>\",\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cntillion.com/api/v2/campaign-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedVersion\": 1,\n \"settings\": {\n \"defaultPolicy\": {\n \"timezone\": \"<string>\",\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ],\n \"retries\": {\n \"maxTotalCalls\": 15,\n \"maxShortRetries\": 14,\n \"maxCallbacks\": 14,\n \"maxRedirects\": 14,\n \"maxConsecutiveFailures\": 15,\n \"retryDelaySeconds\": 302400,\n \"rotateStepSeconds\": 43200\n },\n \"dataCollection\": {\n \"callbacks\": true,\n \"redirects\": true,\n \"doNotCall\": true,\n \"mappings\": [\n {\n \"field\": \"<string>\",\n \"variable\": \"<string>\"\n }\n ]\n },\n \"useRecipientTimezone\": false,\n \"followUpContext\": {\n \"callType\": true,\n \"previousConversationId\": true,\n \"previousSummary\": true,\n \"previousTranscript\": true\n }\n },\n \"whatsappVoice\": {\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"agentOverrides\": [\n {\n \"agentId\": \"<string>\",\n \"timezone\": \"<string>\",\n \"useRecipientTimezone\": true,\n \"callingWindows\": [\n {\n \"weekdays\": [\n 3\n ],\n \"intervals\": [\n {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"version": 123,
"settings": {
"defaultPolicy": {
"timezone": "<string>",
"useRecipientTimezone": false,
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
],
"retries": {
"maxTotalCalls": 15,
"maxShortRetries": 14,
"maxCallbacks": 14,
"maxRedirects": 14,
"maxConsecutiveFailures": 15,
"retryDelaySeconds": 302400,
"intervalPlacement": "start",
"rotateStepSeconds": 43200
},
"dataCollection": {
"callbacks": true,
"redirects": true,
"doNotCall": true,
"mappings": [
{
"field": "<string>",
"variable": "<string>"
}
]
},
"followUpContext": {
"callType": true,
"previousConversationId": true,
"previousSummary": true,
"previousTranscript": true
}
},
"whatsappVoice": {
"timezone": "<string>",
"useRecipientTimezone": true,
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
],
"retries": {
"maxTotalCalls": 15,
"maxShortRetries": 14,
"maxCallbacks": 14,
"maxRedirects": 14,
"maxConsecutiveFailures": 15,
"retryDelaySeconds": 302400,
"intervalPlacement": "start",
"rotateStepSeconds": 43200
},
"dataCollection": {
"callbacks": true,
"redirects": true,
"doNotCall": true,
"mappings": [
{
"field": "<string>",
"variable": "<string>"
}
]
},
"followUpContext": {
"callType": true,
"previousConversationId": true,
"previousSummary": true,
"previousTranscript": true
}
},
"agentOverrides": [
{
"agentId": "<string>",
"timezone": "<string>",
"useRecipientTimezone": true,
"callingWindows": [
{
"weekdays": [
3
],
"intervals": [
{
"start": "<string>",
"end": "<string>"
}
]
}
],
"retries": {
"maxTotalCalls": 15,
"maxShortRetries": 14,
"maxCallbacks": 14,
"maxRedirects": 14,
"maxConsecutiveFailures": 15,
"retryDelaySeconds": 302400,
"intervalPlacement": "start",
"rotateStepSeconds": 43200
},
"dataCollection": {
"callbacks": true,
"redirects": true,
"doNotCall": true,
"mappings": [
{
"field": "<string>",
"variable": "<string>"
}
]
},
"followUpContext": {
"callType": true,
"previousConversationId": true,
"previousSummary": true,
"previousTranscript": true
}
}
]
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}