Skip to main content

auth.exportLoginToken

Generate a login token, for login via QR code. The generated login token should be encoded using base64url, then shown as a tg://login?token=base64encodedtoken deep link » in the QR code. For more info, see login via QR code.

func (c *Client) AuthExportLoginToken(ctx context.Context, request *AuthExportLoginTokenRequest) (AuthLoginTokenClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.AuthExportLoginToken(ctx, &tg.AuthExportLoginTokenRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // AuthLoginTokenClass
return nil
})

Parameters

NameTypeRequiredDescription
APIIDintyesApplication identifier (see. App configuration)
APIHashstringyesApplication identifier hash (see. App configuration)
ExceptIDs[]int64yesList of already logged-in user IDs, to prevent logging in twice with the same user

Returns

AuthLoginTokenClass

Possible errors

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

References