Likes
Liking/Unliking operations
Adds a like to a specific blog post. Increments likes count.
Authorizations
Path parameters
blogIdstring · objectidRequired
ID of the blog post.
Responses
200
Blog liked successfully. Returns new likes count.
application/json
400
User has already liked this blog.
application/json
401
Authentication information is missing or invalid (e.g., missing/expired token).
application/json
404
The specified resource was not found.
application/json
500
An unexpected error occurred on the server.
application/json
post
POST /api/v1/likes/blog/{blogId} HTTP/1.1
Host: blog-api.codewithsadee.com
Authorization: Bearer JWT
Accept: */*
{
"likesCount": 15
}
Removes a like from a specific blog post. Decrements likes count.
Authorizations
Path parameters
blogIdstring · objectidRequired
ID of the blog post.
Responses
204
Request successful, no response body.
400
User has not liked this blog previously.
application/json
401
Authentication information is missing or invalid (e.g., missing/expired token).
application/json
404
The specified resource was not found.
application/json
500
An unexpected error occurred on the server.
application/json
delete
DELETE /api/v1/likes/blog/{blogId} HTTP/1.1
Host: blog-api.codewithsadee.com
Authorization: Bearer JWT
Accept: */*
No content
Was this helpful?