Get likes count for an article and whether the current user has liked it
GET
/cms/content/{id}/likes
const url = 'https://api.example.com/cms/content/example/likes';const options = { method: 'GET', headers: {'API-Key': '<API-Key>', Authorization: 'Bearer <token>', Token: '<Token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.example.com/cms/content/example/likes \ --header 'API-Key: <API-Key>' \ --header 'Authorization: Bearer <token>' \ --header 'Token: <Token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Content ID
Responses
Section titled “Responses”Likes count
Media typeapplication/json
object
likes
Total likes count for the article
integer
liked
Whether the current user has liked the article
boolean
Example generated
{ "likes": 1, "liked": true}