Authentication
The DCDial API uses tokens. You log in once with a username and password, and send the returned token with every other request.
Get a token
Section titled “Get a token”Call Log in (type=login_user) with your DCDial username and password:
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" } }Use the token
Section titled “Use the token”Send it as the token field next to type and the endpoint’s own fields:
curl https://api.dcdial.com/api/ -d type=get_profile -d token="$DCDIAL_TOKEN"How long a token lasts
Section titled “How long a token lasts”- A token is valid for 12 hours by default. Pass
hourswhen 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;}Permissions
Section titled “Permissions”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.
Keep credentials safe
Section titled “Keep credentials safe”- 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.