LegalStack

Telegram WebApp

Telegram WebApp для встроенных форм.

Аутентификация Telegram WebApp по initData и выдача токенов

POST
/telegram/webapp/auth

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

initData*string

Строка initData из Telegram WebApp (подписана ботом)

Тело ответа

application/json

application/problem+json

application/problem+json

curl -X POST "https://loading/telegram/webapp/auth" \  -H "Content-Type: application/json" \  -d '{    "initData": "string"  }'
{
  "accessToken": "string",
  "refreshToken": "string",
  "user": {
    "email": "string",
    "id": "string",
    "teamId": "string",
    "property1": null,
    "property2": null
  }
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}