curl --request POST \
--url https://api.example.com/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>"
}
}Authenticate using Telegram Login Widget data.
This endpoint validates data from Telegram Login Widget and returns JWT tokens for authenticated access.
curl --request POST \
--url https://api.example.com/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>"
}
}Request for Telegram Login Widget authentication.
Telegram user ID
User's first name
64Unix timestamp of authentication
Authentication hash
64User's last name
64User's username
32User's photo URL
512Campaign slug from web link
1 - 64^[a-zA-Z0-9_-]+$Referral code of inviter
32^[a-zA-Z0-9_-]+$Successful Response
Full authentication response with tokens and user.