Campaign statistics
Returns overall statistics for one campaign.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
get_campaign_statsfor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
ID of the campaign.
Example1024
curl https://api.dcdial.com/api/ \ -d type=get_campaign_stats \ -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' => 'get_campaign_stats', '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: "get_campaign_stats", 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": "get_campaign_stats", "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": "", "campaigns_stats": [ { "campaign_id": "click", "campaign_name": "0", "pace_method": "0", "pace_tempo": "0", "intensity_throttle": "0", "adaptive_dropped_percentage": "NA", "agent_level": "0", "caller_id": "0", "campaign_script": "0", "recording": "0", "scheduled_campaign": "0", "contact_schedule": "0", "total_leads": "0", "active_leads": "0", "remaining_leads": "0", "percentage_complete": "0", "answered_today": "0", "called_today": "0", "percentage_dropped": "0", "average_wrap_time": "0", "average_call_interval": "0", "average_talkoff_time": "0", "average_no_of_agents": "0", "active_calls": "0", "calls_ringings": "0", "calls_waiting": "0", "calls_in_ivr": "0", "total": "0", "ready": "0", "oncalls": "0", "wrappingup": "0", "paused": "0", "dead": "0", "active": "0", "display_status": "0", "scheduler_status": "0", "connected_calls": "0", "total_calls": "0", "todays_minutes": "0", "todays_charge": "0", "mtd_minutes": "0", "mtd_charge": "0", "remaining_time": "00:00:00", "recycled": "0", "am_detection": "NA", "am_leave_message": "NA", "call_back_number": "NA", "transfer_queue": "NA", "human_answered_calls": "0", "answering_machine": "0", "transfers": "0", "sales": "0" } ], "graph_data": [] }}Try it