API Documentation
Welcome to the documentation for our API! This document provides an overview of our API endpoints, request formats, and response formats.
Endpoints
Our API has the following endpoints:
GET /users
- Retrieves a list of all users.GET /users/:id
- Retrieves a specific user by their id.POST /users
- Creates a new user.PUT /users/:id
- Updates an existing user's information.DELETE /users/:id
- Deletes a user by their id.GET /items
- Retrieves a list of all items.GET /items/:id
- Retrieves a specific item by their id.POST /items
- Creates a new item.PUT /items/:id
- Updates an existing item's information.DELETE /items/:id
- Deletes an item by their id.
Request Formats
All API requests must be sent as JSON format. The request body should contain the data to be added or updated, while the query parameters can be used for filtering and sorting.
Example Request
POST /users
Content-Type: application/json
{
"name": "John Doe",
"email": "john.doe@example.com"
}
Response Formats
All API responses will be in JSON format, with a standard response structure including the following fields:
statusCode
: The HTTP status code of the response.message
: A brief description of the response.data
: An array or object containing the requested data.
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"statusCode": 200,
"message": "User created successfully",
"data": {
"id": 1,
"name": "John Doe",
"email": "john.doe@example.com"
}
}