GET /users

Vrací stránkovaný seznam uživatelů. Přístup pouze pro administrátory.

Query parameters

  • page integer

    Číslo stránky (od 1)

    Minimum value is 1. Default value is 1.

  • limit integer

    Počet záznamů na stránku

    Minimum value is 1, maximum value is 100. Default value is 20.

  • role string

    Filtrování podle role

    Values are admin or user.

Responses

  • 200 application/json

    Seznam uživatelů načten. Vrací pole všech uživatelů a stránkování.

    Hide response attributes Show response attributes object
    • data array[object]
      Hide data attributes Show data attributes object
      • id
      • username string
      • email string
    • pagination object
      Hide pagination attributes Show pagination attributes object
      • page integer
      • limit integer
      • total integer
  • 401 application/json

    Chyba autentizace

    Hide response attributes Show response attributes object
    • code string
    • message string
  • 403 application/json

    Nedostatečná oprávnění

    Hide response attributes Show response attributes object
    • code string
    • message string
  • 500 application/json

    Chyba serveru

    Hide response attributes Show response attributes object
    • code string
    • message string
GET /users
curl \
 --request GET 'https://api.mstonjek.cz/v1/users' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "data": [
    {
      "id": "8d3f7e7a-6a6b-4b99-9b52-6f9d7d2a0a11",
      "username": "petr-jisa",
      "email": "mr@jisa.com"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150
  }
}
Response examples (401)
{
  "code": "UNAUTHORIZED",
  "message": "Token není platný"
}
Response examples (403)
{
  "code": "FORBIDDEN",
  "message": "Nemáte oprávnění"
}
Response examples (500)
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Server momentálně nedostupný"
}