Skip to main content

Like an Article

Add a like to an article. Requires authentication.

Endpoint

POST /insights/news/:id/like

Authentication

Requires valid access token (Bearer authentication).

Path Parameters

id
integer
required
Article ID to like

Response

success
boolean
Always true for successful requests
data
object
Updated article like information

Example Request

curl -X POST https://api.ceboelha.com/insights/news/42/like \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Example Response

{
  "success": true,
  "data": {
    "articleId": 42,
    "likes": 156,
    "userLiked": true
  }
}

Unlike an Article

Remove your like from an article. Requires authentication.

Endpoint

DELETE /insights/news/:id/like

Authentication

Requires valid access token (Bearer authentication).

Path Parameters

id
integer
required
Article ID to unlike

Response

success
boolean
Always true for successful requests
data
object
Updated article like information

Example Request

curl -X DELETE https://api.ceboelha.com/insights/news/42/like \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Example Response

{
  "success": true,
  "data": {
    "articleId": 42,
    "likes": 155,
    "userLiked": false
  }
}

Error Responses

401 Unauthorized
Invalid or expired access token
404 Not Found
Article ID not found
409 Conflict
When trying to like an article you’ve already liked, or unlike an article you haven’t liked

Notes

  • Users can only like an article once
  • Liking an article you’ve already liked returns a 409 Conflict error
  • Unliking an article you haven’t liked returns a 409 Conflict error
  • Like counts are updated in real-time
  • Authentication is required to prevent abuse

Build docs developers (and LLMs) love