Add article views
POST https://secure.usedesk.com/uapi/support/{account_id}/articles/{id}/add-views, {account_id} — Knowledge base ID in the system, {id} — Article ID.
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 changes the number of views
* — required fields
| Parameter |
Value
|
|---|---|
| api_token* | Channel API token |
| count | Number of views to be added |
PHP request example
$baseId = 2;
$articleId = 96;
$data = array(
'api_token'=> 'e1cbe1c1c9d910ef2ae975215644cb53dd555de4',
'count' => 3 // Adds 3 views to the article
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://secure.usedesk.com/uapi/support/'. $baseId .'/' . $articleId . '/add-views?' . http_build_query($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
return $result;
Example of a response from server
{
"res" : 1,
"views": 15
}
Server response parameters
| Parameter | Value |
|---|---|
| res |
Result 0 — didn't record |
| views |
The total number of views after the request |