Add rating to the article

GET{account_id}/articles/{id}/change-rating, {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 —

The method changes the article rating

* — required fields

api_token* Channel API token
count_positive Number of positive evaluations to be added

Number of negative evaluations to be added

PHP request example
$baseId = 2;
$articleId = 96;
$data = array(
    'api_token'=> 'e1cbe1c1c9d910ef2ae975215644cb53dd555de4',
    'count_negative' => 3 
    'count_positive' => 3 
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, ''. $baseId .'/' . $articleId . '/add-views?' . http_build_query($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
return $result;

Example of a response from server
        "positive": 1,
        "negative": 123

Description of response parameter:

Parameter Value

The total number of positive ratings after the request

negative The total number of negative ratings after the request