Reactions
Get and manage article reactions — likes, claps, and bookmarks — via the MisarBlog API.
Overview
Reactions allow readers to express appreciation for articles. Three types are supported: like, clap, and bookmark. Each reader can hold at most one of each type per article. All reaction endpoints require API key authentication.
Get Reactions
GET api.misar.io/blog/v1/reactions
Returns reaction counts and the authenticated user's current reactions for a given article.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
article_id | string (UUID) | Yes | The article to query reactions for |
Response
200 OK
{
"article_id": "550e8400-e29b-41d4-a716-446655440000",
"counts": {
"like": 42,
"clap": 18,
"bookmark": 7
},
"total": 67,
"user_reactions": ["like"]
}article_idstringThe queried article's UUID.
countsobjectPer-type reaction counts. Always includes like, clap, and bookmark keys.
totalnumberSum of all reaction counts across all types.
user_reactionsstring[]Array of reaction types the authenticated user has set. Empty array if the user has not reacted. Possible values: "like", "clap", "bookmark".
Example
curl "https://api.misar.io/blog/v1/reactions?article_id=550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer mbk_your_api_key"Add a Reaction
POST api.misar.io/blog/v1/reactions
Adds a reaction to an article. If the user has already set this reaction type, the call is a no-op (idempotent).
Request Body
{
"article_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "clap"
}article_idstringrequiredUUID of the article to react to.
type"like" | "clap" | "bookmark"requiredThe reaction type to add.
Response
201 Created — reaction added.
{ "success": true, "reacted": true, "toggled": true }200 OK — reaction already existed, no change.
{ "success": true, "reacted": true, "toggled": false }toggledbooleantrue if this call created a new reaction row; false if it already existed.
Example
curl -X POST "https://api.misar.io/blog/v1/reactions" \
-H "Authorization: Bearer mbk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"article_id": "550e8400-e29b-41d4-a716-446655440000", "type": "clap"}'Remove a Reaction
DELETE api.misar.io/blog/v1/reactions
Removes a specific reaction type from an article for the authenticated user.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
article_id | string (UUID) | Yes | The article to remove the reaction from |
type | "like" | "clap" | "bookmark" | Yes | The reaction type to remove |
Response
200 OK
{ "success": true, "reacted": false }Example
curl -X DELETE \
"https://api.misar.io/blog/v1/reactions?article_id=550e8400-e29b-41d4-a716-446655440000&type=clap" \
-H "Authorization: Bearer mbk_your_api_key"