Get a list of clients
POST https://secure.usedesk.com/uapi/clients
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 |
| created_after |
Filter by date and time of creation Clients created after (inclusive of) the specified date will be included in the extradition. Example of usage: "created_after": "2022-01-01 00:00" |
| created_before |
Filter by date and time of creation Clients created before (inclusive of) the specified date will be included in the extradition. Example of usage: "created_before": "2022-12-31 23:59" |
| offset |
Offset Does not accept null Offset by 1 will show the next 100 entries |
| query |
Search by customer name, email and phone number Accepts only one value |
|
search_type |
Search type Accepts one of two values:
If no parameter is specified, partial_match is selected by default |
$data = array(
'api_token'=> 'e1cbe1c1c9d910ef2ae975215644cb53dd555de4',
'offset'=>0,
'created_after' =>'2016-11-25 00:00',
'created_before'=>'2016-11-25 15:08',
);
$mch_api = curl_init();
curl_setopt($mch_api, CURLOPT_URL, 'https://secure.usedesk.com/uapi/clients');
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;
[
{
"id": 1,
"name": "UseDesk",
"emails": "support@usedesk.com",
"phone": null,
"tickets": [
1,
3089372,
3091416
]
},
{
"id": 16,
"name": "Google+",
"emails": null,
"phone": null,
"tickets": []
},
{
"id": 17,
"name": "Shazam",
"emails": "shazam@email.shazam.com",
"phone": null,
"tickets": []
},
{
"id": 18,
"name": "Google Play",
"emails": "news-googleplay@google.com",
"phone": null,
"tickets": [
3088240
]
}
]
Server response parameters
| Parameter | Description |
| id | Customer ID |
| name | Client Name |
| emails | Client Email |
| phone | Client phone |
| tickets | Array with client ticket IDs |