Update a client
POST https://secure.usedesk.com/uapi/update/client
Warning. If you use the server version of Usedesk, you will have a different URL of methods. Check the URL for the API with our team — support@usedesk.com.
The method allows you to edit client information.
| Parameter | Value |
| api_token* | Channel API token |
| client_id* | Client ID |
| name | New client name |
| emails |
Array with email addresses The system will add emails to existing ones |
| messengers |
Array with messenger data that can be updated or added to the client card Contains parameters:
|
| note | Note text |
| is_new_note |
New Note Flag If false or no parameter is set, the note text is added to the existing |
| phone |
User phone The system will add the phone to the existing |
| sites |
Array with client sites Contains parameters:
|
| avatar |
Image file multipart/form-data |
| status_vip |
Client status: vip Possible values:
It cannot be used simultaneously with the status_spam parameter. |
| status_spam |
Client status: spam Possible values:
It cannot be used simultaneously with the status_vip parameter. |
| position | Client position |
| merge_id | Identifier of the client with which the user with the client_id identifier will be merged |
| client_country | Client country |
| client_city | Client city |
| client_address | Client address |
| new_address |
New address flag Passed if you want to create an additional address |
| phone_type |
Phone type when saving Possible values:
|
Important: the status parameter has been deprecated, replaced by the status_spam and status_vip parameters.
$data = array(
'api_token'=> 'e1cbe1c1c9d910ef2ae975215644cb53dd555de4',
'client_id'=>1234,
'name' =>'Jon',
'emails'=>['test@gmail.com'],
);
$mch_api = curl_init();
curl_setopt($mch_api, CURLOPT_URL, 'https://secure.usedesk.com/uapi/update/client');
curl_setopt($mch_api, CURLOPT_RETURNTRANSFER, true);
curl_setopt($mch_api, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($mch_api, CURLOPT_TIMEOUT, 10);
curl_setopt($mch_api, CURLOPT_POST, true);
curl_setopt($mch_api, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($mch_api, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($mch_api);
return $result;
{
"client_id": 1234,
"status": true
}
Server response parameters
| Parameter | Description |
| client_id | Client ID |
| status | Request execution status |