Authentication

POST /client/login

Client authentication using email and password.

application/json

Body Required

Responses

  • 200 application/json

    Successful client authentication.

    Hide response attributes Show response attributes object
    • success boolean

      Whether authentication is successful

    • session object

      Additional properties are allowed.

      Hide session attributes Show session attributes object
      • created_at string(date) Required

        Session creation date

      • expires_at string(date) Required

        Session expiry date

      • jwt string Required

        Generated JWT

      • revoked boolean Required

        Whether this session is revoked

      • session_id integer Required

        Id of the session in database

    • client object

      Additional properties are allowed.

      Hide client attributes Show client attributes object
  • 400 application/json

    Validation error of given input.

    Hide response attributes Show response attributes object
  • 401 application/json

    User is not unauthorized or permissions are missing.

    Hide response attributes Show response attributes object
  • 404 application/json

    Nothing found with given input.

    Hide response attributes Show response attributes object
  • 429 application/json

    Rate limit exceeded - 100 queries per 15 minutes.

    Hide response attributes Show response attributes object
POST /client/login
curl \
 -X POST http://63.141.232.244:25540/v0/client/login \
 -H "Content-Type: application/json" \
 -d '{"email_address":"Og0rB@example.com","password":"1234567890"}'
Request examples
{
  "email_address": "Og0rB@example.com",
  "password": "1234567890"
}
Response examples (200)
{
  "success": true,
  "session": {
    "jwt": "jE92mGiq2S.e2s1.da239-Z983ns",
    "revoked": false,
    "created_at": "2024-10-10T18:36:47Z",
    "expires_at": "2024-11-10T18:36:47Z",
    "session_id": 1
  },
  "client": {
    "client_id": 1,
    "last_name": "Иванов",
    "created_at": "2024-10-10T18:36:47Z",
    "first_name": "Иван",
    "patronymic": "Иванович",
    "phone_number": "79174236278",
    "email_address": "Og0rB@example.com",
    "profile_picture_url": "https://example.com/profile_picture.jpg"
  }
}
Response examples (400)
{
  "success": false,
  "error": [
    {
      "code": "invalid_type",
      "expected": "string",
      "received": "undefined",
      "path": [
        "client_id"
      ],
      "message": "Required"
    }
  ]
}
Response examples (401)
{
  "success": false,
  "error": "Unauthorized"
}
Response examples (404)
{
  "success": false,
  "error": "Not found"
}
Response examples (429)
{
  "success": false,
  "error": "Too many requests, please try again later"
}