Layer 220
AuthSignUp
Registers a validated phone number in the system.
method
Users
auth.signUp#aac7b717 flags:# no_joined_notifications:flags.0?true phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| NoJoinedNotifications | flags.0?true | If set, users on Telegram that have already added phone_number to their contacts will not receive signup notifications about this user. |
| PhoneNumber | string | Phone number in the international format |
| PhoneCodeHash | string | SMS-message ID |
| FirstName | string | New user first name |
| LastName | string | New user last name |
Returns
auth.AuthorizationPossible 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. |
Gogram Example
// AuthSignUp - using Params struct result, err := client.AuthSignUp(&tg.AuthSignUpParams{ PhoneNumber: "...", PhoneCodeHash: "...", FirstName: "...", LastName: "...", // Optional fields: // NoJoinedNotifications: true, }) if err != nil { // handle error } // result is *tg.AuthAuthorization