Update an agent
POST https://secure.usedesk.com/uapi/update/user
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.
* — required fields
Parameter | Value |
api_token* | Channel API token |
user_id* | Agent id |
name | Agent's name |
Agent's email |
|
role |
User type or role Possible values:
|
group | Default group |
phone | Agent's phone number |
chat_online_status |
Chat agent online status Possible values:
|
ticket_online_status |
Agent online status in tickets Possible values:
|
avatar |
Avatar No more than 15 MB For deletion accepts the value delete |
Request example
{ 'user_id': '2154861' 'name': 'Agent Name', 'email': 'agentemail@gmail.com', 'role': 'admin' 'group': '123', 'phone': '89156743287', 'chat_online_status': 'true', 'ticket_online_status': 'false' }
PHP request example
$data = array( 'api_token'=> 'e1cbe1c1c9d910ef2ae975215644cb53dd555de4', 'user_id'=> '2154861' 'name' => 'Agent Name', 'email' => 'agentemail@gmail.com', 'role' => 'admin', 'group' => '123', 'phone' => '89156743287' ); $mch_api = curl_init(); curl_setopt($mch_api, CURLOPT_URL, 'https://secure.usedesk.com/uapi/update/user'); curl_setopt($mch_api, CURLOPT_USERAGENT, 'PHP-MCAPI/2.0'); 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;
Example of a response from server
{ "status":"success", "user_id":2154861 }
Server response parameters
Parameter | Description |
user_id | Agent ID |
status | Request execution status |