Add an account to a campaign
Adds one account, with its phone numbers and email addresses, to a campaign list so the campaign can call it. If you leave out list_id, a new list is created for the campaign.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
add_leadsfor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
Campaign the account is added to.
Example1024Comma-separated phone numbers. The time zone is looked up from each number.
Example5550100123,5550100124List to add the account to. A new list is created when omitted.
Example2048Comma-separated email addresses.
Example[email protected]Your reference for the account (its accountid).
ExampleACC-10045First name.
ExampleJaneMiddle initial.
Last name.
ExampleDoeTitle, such as Mr or Ms.
Address line 1.
Example100 Main StAddress line 2.
Address line 3.
City.
ExampleAtlantaTwo-letter state code.
ExampleGAZIP or postal code.
Example30301How to work out the account’s time zone: AREA (by area code, the default) or POSTAL (by postal code).
ExampleAREACountry code.
ExampleUSOutstanding balance.
Example1250.5Gender.
Date of birth (YYYY-MM-DD).
Company name, for business accounts.
Company website, for business accounts.
Your source or vendor reference.
Custom fields custom1 to custom20. They are stored on the account and can be used in scripts and templates.
Notes
Send one request per account. To load many accounts at once, use Upload an account file.
curl https://api.dcdial.com/api/ \ -d type=add_leads \ -d token="$DCDIAL_TOKEN" \ -d campaign_id=1024 \ -d phones='5550100123,5550100124'<?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' => 'add_leads', 'token' => getenv('DCDIAL_TOKEN'), 'campaign_id' => 1024, 'phones' => '5550100123,5550100124', ]),]);$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: "add_leads", token: process.env.DCDIAL_TOKEN, campaign_id: "1024", phones: "5550100123,5550100124", }),});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": "add_leads", "token": os.environ["DCDIAL_TOKEN"], "campaign_id": 1024, "phones": "5550100123,5550100124", }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "response": { "success": "1", "msg": "Thanks! Our Support team will contact you soon" }}Try it