Программный интерфейс

/web_api/auth/login

/web_api/auth/login ​

Страница собрана из снимка JSON Schema в репозитории документации. Снимок обновляется отдельной командой из каталога основного приложения и при сборке сайта не переписывается.

Запрос ​

main-app://schemas/api_auth/login.request.json

POST /web_api/auth/login body

ИмяТипОбязательноеОграничение
emailstringДаminLength 1
passwordstringДаminLength 1
devicestringНетmaxLength 255

Другие поля верхнего уровня запрещены.

Ответ ​

main-app://schemas/api_auth/login.response.json

POST /web_api/auth/login success

ИмяТипОбязательноеОграничение
api_codeintegerДаconst 200
api_resultobjectДадругие поля запрещены
emptybooleanНет-

Другие поля верхнего уровня запрещены.

api_result ​

ИмяТипОбязательноеОграничение
access_tokenstringДаminLength 1
token_typestringДаconst "Bearer"
expires_in_daysintegerДаminimum 1
userobjectДадругие поля запрещены

api_result.user ​

ИмяТипОбязательноеОграничение
idintegerДаminimum 1
emailstringДаminLength 1
first_namestringДа-
last_namestringДа-

Исходная схема ​

Файлы ниже скопированы из снимка без изменений. Фрагмент по $ref приведён отдельным блоком, схемы не сливаются.

Запрос: main-app://schemas/api_auth/login.request.json
json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "main-app://schemas/api_auth/login.request.json",
  "title": "POST /web_api/auth/login body",
  "type": "object",
  "required": ["email", "password"],
  "additionalProperties": false,
  "properties": {
    "email": { "type": "string", "minLength": 1 },
    "password": { "type": "string", "minLength": 1 },
    "device": { "type": "string", "maxLength": 255 }
  }
}
Ответ: main-app://schemas/api_auth/login.response.json
json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "main-app://schemas/api_auth/login.response.json",
  "title": "POST /web_api/auth/login success",
  "allOf": [
    { "$ref": "main-app://schemas/_shared/envelope-success.json" },
    {
      "type": "object",
      "properties": {
        "api_result": { "$ref": "main-app://schemas/_shared/auth-token-result.json" }
      }
    }
  ]
}
Фрагмент: main-app://schemas/_shared/envelope-success.json
json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "main-app://schemas/_shared/envelope-success.json",
  "title": "Canonical success envelope",
  "type": "object",
  "required": ["api_code", "api_result"],
  "properties": {
    "api_code": { "const": 200 },
    "api_result": true,
    "empty": { "type": "boolean" }
  },
  "additionalProperties": false
}
Фрагмент: main-app://schemas/_shared/auth-token-result.json
json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "main-app://schemas/_shared/auth-token-result.json",
  "title": "api_result of /web_api/auth/login and /web_api/auth/register",
  "type": "object",
  "required": ["access_token", "token_type", "expires_in_days", "user"],
  "additionalProperties": false,
  "properties": {
    "access_token": { "type": "string", "minLength": 1 },
    "token_type": { "const": "Bearer" },
    "expires_in_days": { "type": "integer", "minimum": 1 },
    "user": { "$ref": "main-app://schemas/_shared/auth-user.json" }
  }
}
Фрагмент: main-app://schemas/_shared/auth-user.json
json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "main-app://schemas/_shared/auth-user.json",
  "title": "User object in /web_api/auth responses",
  "type": "object",
  "required": ["id", "email", "first_name", "last_name"],
  "additionalProperties": false,
  "properties": {
    "id": { "type": "integer", "minimum": 1 },
    "email": { "type": "string", "minLength": 1 },
    "first_name": { "type": "string" },
    "last_name": { "type": "string" }
  }
}

Версия 1.0.0 · Последнее изменение 2026-10-07

Страница не помогла?