torarnehave1 / slowyouio

0 stars 0 forks source link

API End Points Guide #47

Open torarnehave1 opened 2 months ago

torarnehave1 commented 2 months ago

API Documentation

This document describes the API endpoints available in our application.

Get Users

Endpoint: /api/users

Method: GET

Description: Fetches all users from the database.

Response: A JSON object with the following properties:

Example Response:


{
  "status": "Connected",
  "users": [
    {
      "id": 1,
      "name": "John Doe",
      "email": "john@example.com"
    },
    {
      "id": 2,
      "name": "Jane Doe",
      "email": "jane@example.com"
    }
  ]
}

Error Response: If there's an error (for example, if the database connection is refused), the API will return a JSON object with the following properties:

status: A string that indicates the status of the request. This will be 'Error' if there was an error.
error: A string that describes the error.
Example Error Response:

{
  "status": "Error",
  "error": "Database connection refused"
}