Skip to main content

Campaign Add

This service is used to add a campaign.

Parameters

DescriptionDefined DataExample DataRequired[**]/Optional[*]Parameters
Campaign Name-test**name
Unique Trunk ID obtained from search-5f6c5b56c92de0068f32e592**trunk_manager_id
Context value in autodialer component route-autointerface_context
Text value in autodialer component route-text1interface_text
Phone Numbers-09212396500*numbers
Unique Group ID obtained from search-"5e96c8c2c92de0468920657e", "5e96d40cc92de025690d0a61"*groups
Time interval between each attempt-600*try_interval
Number of retries-1*try
Campaign Start Time-2021-02-19 15:17*start
Campaign End Time-2021-02-23 15:17*end
Unique Audio File ID obtained from search-5e5b629ec92de075df7af457*announcement
Description--description

Sample Invocation

Show Full Source Code PHP

	<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "http://192.168.51.21/api/v4/autodialer/campaigns/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>"{\r\n \"name\":\"test\",\r\n \"trunk_manager_id\":\"5f6c5b56c92de0068f32e592\",\r\n \"interface_context\":\"auto\",\r\n \"interface_text\":\"text1\",\r\n \"numbers\":[\"09212396500\"],\r\n \"groups\":[\"5e96c8c2c92de0468920657e\",\"5e96d40cc92de025690d0a61\"],\r\n \"try_interval\":\"600\",\r\n \"try\":\"1\",\r\n \"start\":\"2021-02-19 15:17\",\r\n \"end\":\"2021-02-23 15:17\",\r\n \"announcement\":\"5e5b629ec92de075df7af457\",\r\n \"description\":\"\",\r\n \"count\":3\r\n}",
CURLOPT_HTTPHEADER => array(
"X-APIKEY: vZKtIKWsld0egNlkzHo8i5LVBqLNBSWARCQsPOSgDjFmAHM3tG",
"Authorization: Basic dGVzdDpBYTEyMzQ1Ng==",
"Content-Type: application/json"
),
));

$response = curl_exec($curl);

if (!curl_errno($curl)) {
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
echo 'response code:'.$httpcode, '<br/>';
}

curl_close($curl);
echo $response;
?>