Skip to main content
POST
/
cabinet
/
auth
/
telegram
/
widget
Auth Telegram Widget
curl --request POST \
  --url http://localhost:8080/cabinet/auth/telegram/widget \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": 123,
  "first_name": "<string>",
  "auth_date": 123,
  "hash": "<string>",
  "last_name": "<string>",
  "username": "<string>",
  "photo_url": "<string>",
  "campaign_slug": "<string>",
  "referral_code": "<string>"
}
'
{
  "access_token": "<string>",
  "refresh_token": "<string>",
  "expires_in": 123,
  "user": {
    "id": 123,
    "created_at": "2023-11-07T05:31:56Z",
    "telegram_id": 123,
    "username": "<string>",
    "first_name": "<string>",
    "last_name": "<string>",
    "email": "<string>",
    "email_verified": false,
    "balance_kopeks": 0,
    "balance_rubles": 0,
    "referral_code": "<string>",
    "language": "ru",
    "auth_type": "telegram"
  },
  "token_type": "bearer",
  "campaign_bonus": {
    "campaign_name": "<string>",
    "bonus_type": "<string>",
    "balance_kopeks": 0,
    "subscription_days": 123,
    "tariff_name": "<string>"
  }
}

Body

application/json

Request for Telegram Login Widget authentication.

id
integer
required

Telegram user ID

first_name
string
required

User's first name

auth_date
integer
required

Unix timestamp of authentication

hash
string
required

Authentication hash

last_name
string | null

User's last name

username
string | null

User's username

photo_url
string | null

User's photo URL

campaign_slug
string | null

Campaign slug from web link

Required string length: 1 - 64
referral_code
string | null

Referral code of inviter

Maximum string length: 32

Response

Successful Response

Full authentication response with tokens and user.

access_token
string
required
refresh_token
string
required
expires_in
integer
required
user
UserResponse · object
required

User data response.

token_type
string
default:bearer
campaign_bonus
CampaignBonusInfo · object

Info about campaign bonus applied during auth.