Quickstart
You need a DCDial user with API access. Ask your DCDial administrator if you don’t have one.
-
Get a token. Send your username and password with
type=login_user.Terminal window curl https://api.dcdial.com/api/ \-d type=login_user \-d user=jane.doe \-d pass="$DCDIAL_PASSWORD"$ch = curl_init('https://api.dcdial.com/api/');curl_setopt_array($ch, [CURLOPT_POST => true,CURLOPT_RETURNTRANSFER => true,CURLOPT_POSTFIELDS => http_build_query(['type' => 'login_user','user' => 'jane.doe','pass' => getenv('DCDIAL_PASSWORD'),]),]);$token = json_decode(curl_exec($ch), true)['response']['token'];const res = await fetch('https://api.dcdial.com/api/', {method: 'POST',body: new URLSearchParams({ type: 'login_user', user: 'jane.doe', pass: process.env.DCDIAL_PASSWORD }),});const { token } = (await res.json()).response;import os, requestsr = requests.post("https://api.dcdial.com/api/", data={"type": "login_user","user": "jane.doe","pass": os.environ["DCDIAL_PASSWORD"],}, timeout=30)token = r.json()["response"]["token"]The response contains your token:
{ "response": { "success": 1, "token": "3f0c2b9e…", "full_name": "Jane", "email": "[email protected]" } } -
List your campaigns. Send the token with
type=get_campaigns.Terminal window curl https://api.dcdial.com/api/ -d type=get_campaigns -d token="$DCDIAL_TOKEN"{"response": {"success": "1","campaigns_list": [{ "campaign_id": "1024", "campaign_name": "Payment reminders", "display_status": "STOP", "active": "N" }]}} -
Start a campaign. Pass its ID with
type=play_campaign. Outbound dialing starts right away.Terminal window curl https://api.dcdial.com/api/ -d type=play_campaign -d token="$DCDIAL_TOKEN" -d campaign_id=1024 -
Check for errors. The API answers with HTTP 200 even when a request fails, so always check
success:{ "response": { "success": "0", "error": "Your token seems expired, please login again", "tech_msg": "invalid_user" } }