Update profile
Updates the user’s name, email or mobile number. Fields you leave out stay unchanged.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
update_profilefor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
Full name.
ExampleJane DoeEmail address.
Example[email protected]Mobile number.
Example5551234567
curl https://api.dcdial.com/api/ \ -d type=update_profile \ -d token="$DCDIAL_TOKEN" \ -d full_name='Jane Doe' \ -d mobile_number=5551234567<?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' => 'update_profile', 'token' => getenv('DCDIAL_TOKEN'), 'full_name' => 'Jane Doe', 'mobile_number' => '5551234567', ]),]);$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: "update_profile", token: process.env.DCDIAL_TOKEN, full_name: "Jane Doe", mobile_number: "5551234567", }),});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": "update_profile", "token": os.environ["DCDIAL_TOKEN"], "full_name": "Jane Doe", "mobile_number": "5551234567", }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "response": { "success": "1", "error": "" }}Try it