Place a test call
Places a single test call with a campaign’s settings, so you can hear the message and check delivery before any account holders are called.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
dial_numberfor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
ID of the campaign.
Example1024Phone number in E.164 or 10-digit US format.
Example5551234567Caller ID to present on the test call.
Example5559876543
curl https://api.dcdial.com/api/ \ -d type=dial_number \ -d token="$DCDIAL_TOKEN" \ -d campaign_id=1024 \ -d phone_number=5551234567 \ -d callerid=5559876543<?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' => 'dial_number', 'token' => getenv('DCDIAL_TOKEN'), 'campaign_id' => 1024, 'phone_number' => '5551234567', 'callerid' => '5559876543', ]),]);$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: "dial_number", token: process.env.DCDIAL_TOKEN, campaign_id: "1024", phone_number: "5551234567", callerid: "5559876543", }),});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": "dial_number", "token": os.environ["DCDIAL_TOKEN"], "campaign_id": 1024, "phone_number": "5551234567", "callerid": "5559876543", }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "response": { "success": 1, "error": "" }}Try it