All Tutorials

Your One-Stop Destination for Learning and Growth

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:

  1. GET /users - Retrieves a list of all users.
  2. GET /users/:id - Retrieves a specific user by their id.
  3. POST /users - Creates a new user.
  4. PUT /users/:id - Updates an existing user's information.
  5. DELETE /users/:id - Deletes a user by their id.
  6. GET /items - Retrieves a list of all items.
  7. GET /items/:id - Retrieves a specific item by their id.
  8. POST /items - Creates a new item.
  9. PUT /items/:id - Updates an existing item's information.
  10. 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"
  }
}

Published March, 2024