auth.signUp

Registers a validated phone number in the system.

auth.authorization#33fb7bb8 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int user:User = auth.Authorization;
auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;
---functions---
auth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;

Parameters

Name Type Description
phone_number string Phone number in the international format
phone_code_hash string SMS-message ID
first_name string New user first name
last_name string New user last name

Result

Returns an auth.Authorization object with information about the new authorization.

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.

Query example

(auth.signUp "79991234567" "2dc02d2cda9e615c84" "44444" "John" "Doe")
=
(auth.authorization
  expires:1403938438
  user:(userSelf
    id:603177
    first_name:"John"
    last_name:"Doe"
    phone:"79991234567"
    photo:(userProfilePhotoEmpty)
    status:(userStatusEmpty)
    inactive:(boolTrue)
  )
)

1b067634 3939370b 33323139 37363534 63643212 32643230 39616463 35313665 00343863 34343405 00003434 686f4a04 0000006e 656f4403 c18027ca
=
f6b673a4 53ae6686 720535ec 00093429 686f4a04 0000006e 656f4403 3939370b 33323139 37363534 4f11bae1 09d05049 997275b5 d8487410