Log in
Exchanges a DCDial username and password for an API token. Send the token as the token field on every other request.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
login_userfor this endpoint.Your DCDial username.
Examplejane.doeYour DCDial password.
Exampleyour-passwordHow long the token stays valid, in hours. Defaults to 12. Every authenticated request extends it.
Example12
Notes
Logins can be restricted to an IP allow-list per company. If your server gets an IP error, ask DCDial support to add its address.
curl https://api.dcdial.com/api/ \ -d type=login_user \ -d user=jane.doe \ -d pass="$DCDIAL_PASSWORD"<?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' => 'login_user', 'user' => 'jane.doe', 'pass' => getenv('DCDIAL_PASSWORD'), ]),]);$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: "login_user", user: "jane.doe", pass: process.env.DCDIAL_PASSWORD, }),});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": "login_user", "user": "jane.doe", "pass": os.environ["DCDIAL_PASSWORD"], }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "response": { "success": 1, "token": "3f0c2b9e…", "full_name": "Jane", "last_name": "Doe", "mobile_number": "5550100123" }}Try it