Free Comment Mock REST API Documentation
The MockX Comment API offers developers the ability to manage comments on posts, facilitating user engagement and content interaction within applications. This guide outlines how to use the API to perform operations such as retrieving, adding, updating, and deleting comments.
Endpoints Overview
This API provides a comprehensive set of endpoints for comment management:
- GET /: Retrieves all comments.
- GET /:id: Fetches a specific comment by ID.
- GET /post/:postId: Retrieves all comments associated with a specific post.
- POST /add: Adds a new comment.
- PUT /:id: Updates an entire comment by ID.
- PATCH /:id: Partially updates a comment by ID.
- DELETE /:id: Deletes a comment by ID.
Get All Comments
Fetch a list of all comments across all posts.
Parameters:
limit: Limits the number of comments returned. skip: Skips a specified number of comments. Example Response:
Get Comment by ID
Retrieve detailed information about a specific comment.
Parameters:
id: The unique identifier of the comment. Example Response:
Get Comments by Post ID
Fetch all comments associated with a specific post.
Parameters:
postId: The unique identifier of the post. Example Response:
Add New Comment
Add a new comment to a post.
Body: Include the post ID, user ID, and body of the comment in the request body.
Example Response:
Update Comment by ID
Modify the details of an existing comment.
Parameters:
id: The unique identifier of the comment to be updated. Body: Include the updated comment details in the request body.
Example Response:
Delete Comment by ID
Remove a comment from a post.
Parameters:
id: The unique identifier of the comment to be deleted. Example Response: