auth.signUp
Registers a validated phone number in the system.
func (c *Client) AuthSignUp(ctx context.Context, request *AuthSignUpRequest) (AuthAuthorizationClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AuthSignUp(ctx, &tg.AuthSignUpRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // AuthAuthorizationClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
NoJoinedNotifications | bool | — | If set, users on Telegram that have already added phone_number to their contacts will not receive signup notifications about this user. |
PhoneNumber | string | yes | Phone number in the international format |
PhoneCodeHash | string | yes | SMS-message ID |
FirstName | string | yes | New user first name |
LastName | string | yes | New user last name |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | FIRSTNAME_INVALID | The first name is invalid. |
| 400 | LASTNAME_INVALID | The last name is invalid. |
| 400 | PHONE_CODE_EMPTY | phone_code is missing. |
| 400 | PHONE_CODE_EXPIRED | The phone code you provided has expired. |
| 400 | PHONE_CODE_INVALID | The provided phone code is invalid. |
| 400 | PHONE_NUMBER_FLOOD | You asked for the code too many times. |
| 406 | PHONE_NUMBER_INVALID | The phone number is invalid. |
| 400 | PHONE_NUMBER_OCCUPIED | The phone number is already in use. |
References
- Official documentation
- Generated Go reference
- TL definition:
auth.signUp#aac7b717