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
| Name | Type | Required | Description |
|---|---|---|---|
APIID | int | yes | Application identifier (see. App configuration) |
APIHash | string | yes | Application identifier hash (see. App configuration) |
ExceptIDs | []int64 | yes | List of already logged-in user IDs, to prevent logging in twice with the same user |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | API_ID_INVALID | API ID invalid. |
| 400 | API_ID_PUBLISHED_FLOOD | This API id was published somewhere, you can't use it now. |
References
- Official documentation
- Generated Go reference
- TL definition:
auth.exportLoginToken#b7e085fe