auth.signIn

Signs in a user with a validated phone number.

auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
---functions---
auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;

Parameters

phone_number string Phone number in the international format
phone_code_hash string SMS-message ID
phone_code string Valid numerical code from the SMS-message

Result

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

Query example

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

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

Errors

Code Type Description
400 BAD_REQUEST PHONE_NUMBER_INVALID Invalid phone number
400 BAD_REQUEST PHONE_CODE_EMPTY phone_code from the SMS is empty
400 BAD_REQUEST PHONE_CODE_EXPIRED SMS expired
400 BAD_REQUEST PHONE_CODE_INVALID Invalid SMS code was sent
400 BAD_REQUEST PHONE_NUMBER_UNOCCUPIED The code is valid but no user with the given number is registered