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:

  • identity — nickname, phone number, other identifiers that are displayed in the client card (required).
    String, 64 characters
  • type — messenger type (required)
    Accepts values:
    • telegram,
    • whatsapp,
    • viber,
    • skype,
    • gtalk,
    • imessage,
    • other
  • uid — id of the user in the messenger (optional)
note Note text
phone Client phone

10 to 15 characters, numbers only
sites

Array with client sites

Contains parameters:

  • url — link to customer site (required)
avatar

Image file

multipart/form-data

status

Client status

Possible values:

  • vip;
  • spammer
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:

  • home;
  • mobile;
  • stationary;
  • fax;
  • other


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;
        


Server response example
{
    "client_id": 1234,
    "status": true
}
                        


Server response parameters

Parameter Description
client_id Client ID
status Request execution status