account.acceptAuthorization
Sends a Telegram Passport authorization form, effectively sharing data with the service
func (c *Client) AccountAcceptAuthorization(ctx context.Context, request *AccountAcceptAuthorizationRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AccountAcceptAuthorization(ctx, &tg.AccountAcceptAuthorizationRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
BotID | int64 | yes | Bot ID |
Scope | string | yes | Telegram Passport element types requested by the service |
PublicKey | string | yes | Service's public key |
ValueHashes | []SecureValueHash | yes | Types of values sent and their hashes |
Credentials | SecureCredentialsEncrypted | yes | Encrypted values |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | BOT_INVALID | This is not a valid bot. |
| 400 | PUBLIC_KEY_REQUIRED | A public key is required. |
References
- Official documentation
- Generated Go reference
- TL definition:
account.acceptAuthorization#f3ed4c73