Update campaign
Changes one or more settings of a campaign. Send only the fields you want to change; get the allowed values from Get campaign settings.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
update_campaignfor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
ID of the campaign.
Example1024Answering-machine detection: Y (on) or N (off).
One ofYNPlay the campaign message: Y or N.
One ofYNUse a custom caller ID list: Y or N.
One ofYNOverride existing settings: Y or N.
One ofYNDial level: how many lines to dial per available agent (0 to 10).
Example1.5How the campaign dials. Shown in the app as Broadcast, Predictive, Power (RATIO), Preview (MANUAL) and SMS Broadcast (SMSB).
One ofBROADCASTPREDICTIVERATIOMANUALSMSBSend answered calls to an external queue: Y or N.
One ofYNAgent level for predictive dialing.
ID of the agent script to show (from Get campaign settings).
Examplescr123Number account holders can call back.
Example5559876543Extension or queue to transfer answered calls to.
ID of the caller ID list to rotate through.
Caller ID shown to account holders.
Example5559876543Maximum number of simultaneous lines.
Example10Secondary dial level used by the adaptive dial methods.
Maximum dropped-call percentage for adaptive dialing (0 to 100).
Example3Record calls: ALLCALLS (on) or NEVER (off).
One ofALLCALLSNEVERID of the calling-hours schedule (from Get campaign settings).
ExampleccsDefaultDialing speed for broadcast campaigns.
Dial prefix: 8 (on) or 9 (off).
One of89
curl https://api.dcdial.com/api/ \ -d type=update_campaign \ -d token="$DCDIAL_TOKEN" \ -d campaign_id=1024<?php$ch = curl_init('https://api.dcdial.com/api/');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => http_build_query([ 'type' => 'update_campaign', 'token' => getenv('DCDIAL_TOKEN'), 'campaign_id' => 1024, ]),]);$result = json_decode(curl_exec($ch), true);curl_close($ch);
if (($result['response']['success'] ?? 0) != 1) { throw new RuntimeException($result['response']['error'] ?? 'Request failed');}const res = await fetch('https://api.dcdial.com/api/', { method: 'POST', body: new URLSearchParams({ type: "update_campaign", token: process.env.DCDIAL_TOKEN, campaign_id: "1024", }),});const { response } = await res.json();if (response.success != 1) throw new Error(response.error);import osimport requests
r = requests.post( "https://api.dcdial.com/api/", data={ "type": "update_campaign", "token": os.environ["DCDIAL_TOKEN"], "campaign_id": 1024, }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "response": { "success": "1", "error": "" }}Try it