account.verifyPhone
Verify a phone number for telegram passport.
func (c *Client) AccountVerifyPhone(ctx context.Context, request *AccountVerifyPhoneRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AccountVerifyPhone(ctx, &tg.AccountVerifyPhoneRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
PhoneNumber | string | yes | Phone number |
PhoneCodeHash | string | yes | Phone code hash received from the call to account.sendVerifyPhoneCode |
PhoneCode | string | yes | Code received after the call to account.sendVerifyPhoneCode |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | PHONE_CODE_EMPTY | phone_code is missing. |
| 400 | PHONE_CODE_EXPIRED | The phone code you provided has expired. |
| 400 | PHONE_NUMBER_INVALID | The phone number is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
account.verifyPhone#4dd3a7f6