Skip to content

Authentication

The DCDial API uses tokens. You log in once with a username and password, and send the returned token with every other request.

Call Log in (type=login_user) with your DCDial username and password:

Terminal window
curl https://api.dcdial.com/api/ -d type=login_user -d user=jane.doe -d pass="$DCDIAL_PASSWORD"
{ "response": { "success": 1, "token": "3f0c2b9e…", "full_name": "Jane", "last_name": "Doe" } }

Send it as the token field next to type and the endpoint’s own fields:

Terminal window
curl https://api.dcdial.com/api/ -d type=get_profile -d token="$DCDIAL_TOKEN"
  • A token is valid for 12 hours by default. Pass hours when you log in to change that.
  • Every authenticated request extends it, so a token that is used regularly keeps working.
  • When it expires, requests fail with "error": "Your token seems expired, please login again". Log in again and retry the request once.
async function call(fields) {
let res = await post({ ...fields, token });
if (res.success != 1 && /token/i.test(res.error)) {
token = await login(); // type=login_user
res = await post({ ...fields, token });
}
return res;
}

A token acts as the user who logged in, with that user’s permissions in DCDial. For example, starting a campaign needs permission to modify campaigns, and adding accounts to a campaign needs permission to create lists or leads. Use Check permission to test a permission before you rely on it.

Create a dedicated DCDial user for each integration, with only the permissions it needs.

  • Always use https://. Plain HTTP is not supported.
  • Don’t log full requests: they contain the token, and payment requests contain card or bank details.
  • Logins can be limited to an IP allow-list for your company. Ask DCDial support to add your server’s address.