Create a client
POST https://secure.usedesk.com/uapi/create/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 create a new client.
| Parameter | Value |
| api_token* | Channel API token |
| name | New customer name |
| emails | Array with emails |
| messengers |
Array with messengers data Contains parameters:
|
| note | Note text |
| phone | Client phone 10 to 15 characters, numbers only |
| sites |
Array with client sites Contains parameters:
|
| avatar |
Image file multipart/form-data |
| status_vip |
Client status Possible values:
It cannot be used simultaneously with the status_spam parameter. |
| status_spam |
Client status Possible values:
It cannot be used simultaneously with the status_vip parameter. |
| position | Customer 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 | The client's city |
| client_address | Customer address |
| new_address | 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.
PHP request example
$data = array(
'api_token'=> 'e1cbe1c1c9d910ef2ae975215644cb53dd555de4',
'name' =>'Jon',
'emails'=>['test@gmail.com'],
);
$mch_api = curl_init();
curl_setopt($mch_api, CURLOPT_URL, 'https://secure.usedesk.com/uapi/create/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 |