Set notification settings
Chooses which in-app alerts the user receives and how they are delivered.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
set_notificationsfor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
Y to turn notifications on for this user, N to turn them off.
One ofYN1 to be alerted when a campaign starts.
One of011 to be alerted when a campaign stops.
One of011 to be alerted when a campaign pauses.
One of011 to be alerted when a campaign runs out of accounts to call.
One of011 to be alerted when a campaign completes.
One of011 to be alerted when a list is added.
One of011 to be alerted when a list scrub report is ready.
One of011 to be alerted when a scheduled campaign starts. (The field name is spelled this way.)
One of01Alert when the dialer balance drops below this amount.
One of50100200300500100020003000Minutes between repeated alerts (0 = once).
One of015304560How to deliver alerts.
One ofpopupemailsms
Notes
The settings you send replace all previous ones. Send 1 for each alert you want to keep.
curl https://api.dcdial.com/api/ \ -d type=set_notifications \ -d token="$DCDIAL_TOKEN" \ -d enable_notification=Y \ -d campaign_started=0 \ -d campaign_stopped=0<?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' => 'set_notifications', 'token' => getenv('DCDIAL_TOKEN'), 'enable_notification' => 'Y', 'campaign_started' => 0, 'campaign_stopped' => 0, ]),]);$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: "set_notifications", token: process.env.DCDIAL_TOKEN, enable_notification: "Y", campaign_started: "0", campaign_stopped: "0", }),});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": "set_notifications", "token": os.environ["DCDIAL_TOKEN"], "enable_notification": "Y", "campaign_started": 0, "campaign_stopped": 0, }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "response": { "success": 1, "error": "" }}Try it