cURL
curl --request POST \ --url https://api.example.com/api/v2/auth/telegram \ --header 'Content-Type: application/json' \ --data ' { "id": 123, "first_name": "<string>", "auth_date": 123, "hash": "<string>", "username": "<string>" } '
Вход через Telegram Login Widget
curl -X POST https://neuralbox.top/api/v2/auth/telegram \ -H "Content-Type: application/json" \ -d '{ "id": 123456789, "first_name": "Иван", "username": "ivan_dev", "auth_date": 1741432800, "hash": "abc123..." }'
{ "access_token": "eyJhbGciOiJIUzI1NiJ9...", "refresh_token": "eyJhbGciOiJIUzI1NiJ9...", "token_type": "bearer", "is_new_user": true, "user": { "id": 12345, "telegram_id": 123456789, "plan": "free", "token_balance": 50 } }