auth.importBotAuthorization #

Login as a bot

Layer 223

auth.authorization#2ea2c0d4 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int future_auth_token:flags.2?bytes user:User = auth.Authorization;
auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;
---functions---
auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;

Parameters #

NameTypeDescription
flagsintReserved for future use
api_idintApplication identifier (see. App configuration)
api_hashstringApplication identifier hash (see. App configuration)
bot_auth_tokenstringBot token (see bots)

Result #

auth.Authorization

Both users and bots can use this method #

This method can be invoked over an unauthenticated connection » #

Possible errors #

CodeTypeDescription
400ACCESS_TOKEN_EXPIREDAccess token expired.
400ACCESS_TOKEN_INVALIDAccess token invalid.
400API_ID_INVALIDAPI ID invalid.
400API_ID_PUBLISHED_FLOODThis API id was published somewhere, you can't use it now.

Bots: An introduction for developers #

Bots are small applications that run entirely within the Telegram app.