The MockX Post API provides a comprehensive suite of functionalities for managing blog posts within your applications. From posting new content to engaging with user comments, this API covers all necessary operations to enhance your content management system.
Endpoints Overview
The Post API includes endpoints for various post-related operations:
GET /: Retrieves all posts.
**GET /search: Searches for posts based on query parameters.
GET /:id: Fetches a specific post by ID.
GET /user/:userId: Retrieves all posts created by a specific user.
GET /:postId/comments: Fetches all comments associated with a specific post.
POST /add: Adds a new post.
PUT /:id: Updates an entire post by ID.
PATCH /:id: Partially updates a post by ID.
DELETE /:id: Deletes a post by ID.
Get All Posts
Fetch a comprehensive list of all posts.
Parameters:
limit: Limits the number of posts returned.
skip: Skips a specified number of posts.
Example Response:
Search Posts
Search for posts based on a query parameter. It will search body of the post for that query.
Parameters:
q: The search query.
Example Response:
Get Post by ID
Retrieve detailed information about a specific post.
Parameters:
id: The unique identifier of the post.
Example Response:
Get Posts by User ID
Fetch all posts created by a specific user.
Example :
Parameters:
userId: The unique identifier of the user.
Example Response:
Get Comments by Post ID
Retrieve all comments associated with a specific post.
Example :
postId: The unique identifier of the post.
Example Response:
Add New Post
Add a new post to the system.
Body:
Include the title, body, user ID, tags, and reactions in the request body.
Example Response:
Update Post by ID
Modify the details of an existing post.
Example :
Parameters:
id: The unique identifier of the post to be updated.
Body:
Include the post details to be updated in the request body.
Example Response:
Delete Post by ID
Remove a post from the system.
Parameters:
id: The unique identifier of the post to be deleted.
Example Response:
MockX offers free, reliable mock APIs for easy testing and development, ideal for developers seeking to enhance their workflow without the complexities of setting up any server.