📘
Blog API
  • Documentation
  • API References
  • Root
  • Authentication
  • Users
  • Blogs
  • Likes
  • Comments
  • Models
Powered by GitBook

© 2025 codewithsadee

On this page

Was this helpful?

Export as PDF

Likes

PreviousBlogsNextComments

Was this helpful?

Liking/Unliking operations

Like Blog Post

post

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
}

Unlike Blog Post

delete

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

  • POSTLike Blog Post
  • DELETEUnlike Blog Post