# Likes

Liking/Unliking operations

## Like Blog Post

> Adds a like to a specific blog post. Increments likes count.

```json
{"openapi":"3.0.3","info":{"title":"Blog API","version":"1.0.0"},"tags":[{"name":"Likes","description":"Liking/Unliking operations"}],"servers":[{"url":"https://blog-api.codewithsadee.com/api/v1","description":"API v1 Base Path"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT Access Token obtained via login/register/refresh"}},"parameters":{"BlogIdParam":{"in":"path","name":"blogId","schema":{"type":"string","format":"objectid"},"required":true,"description":"ID of the blog post."}},"schemas":{"ErrorResponse":{"type":"object","properties":{"code":{"type":"string","description":"Application-specific error code"},"message":{"type":"string","description":"Human-readable error message"}},"required":["code","message"]}},"responses":{"Unauthorized":{"description":"Authentication information is missing or invalid (e.g., missing/expired token).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"The specified resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServerError":{"description":"An unexpected error occurred on the server.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/likes/blog/{blogId}":{"post":{"tags":["Likes"],"summary":"Like Blog Post","description":"Adds a like to a specific blog post. Increments likes count.","operationId":"likeBlog","parameters":[{"$ref":"#/components/parameters/BlogIdParam"}],"responses":{"200":{"description":"Blog liked successfully. Returns new likes count.","content":{"application/json":{"schema":{"type":"object","properties":{"likesCount":{"type":"integer"}}}}}},"400":{"description":"User has already liked this blog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Unlike Blog Post

> Removes a like from a specific blog post. Decrements likes count.

```json
{"openapi":"3.0.3","info":{"title":"Blog API","version":"1.0.0"},"tags":[{"name":"Likes","description":"Liking/Unliking operations"}],"servers":[{"url":"https://blog-api.codewithsadee.com/api/v1","description":"API v1 Base Path"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT Access Token obtained via login/register/refresh"}},"parameters":{"BlogIdParam":{"in":"path","name":"blogId","schema":{"type":"string","format":"objectid"},"required":true,"description":"ID of the blog post."}},"responses":{"NoContent":{"description":"Request successful, no response body."},"Unauthorized":{"description":"Authentication information is missing or invalid (e.g., missing/expired token).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"The specified resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServerError":{"description":"An unexpected error occurred on the server.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","properties":{"code":{"type":"string","description":"Application-specific error code"},"message":{"type":"string","description":"Human-readable error message"}},"required":["code","message"]}}},"paths":{"/likes/blog/{blogId}":{"delete":{"tags":["Likes"],"summary":"Unlike Blog Post","description":"Removes a like from a specific blog post. Decrements likes count.","operationId":"unlikeBlog","parameters":[{"$ref":"#/components/parameters/BlogIdParam"}],"responses":{"204":{"$ref":"#/components/responses/NoContent"},"400":{"description":"User has not liked this blog previously.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blog-api.codewithsadee.com/references/likes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
