send_code()

Client.send_code()

Send the confirmation code to the given phone number.

Usable by Users Bots
Parameters:
  • phone_number (str) – Phone number in international format (includes the country prefix).

  • current_number (bool, optional) – Pass True if the phone number is used on the current device. Ignored if allow_flashcall is not set. Defaults to None.

  • allow_flashcall (bool, optional) – Whether to allow phone verification via phone calls. Defaults to None.

  • allow_app_hash (bool, optional) – If a token that will be included in eventually sent SMSs is required: required in newer versions of android, to use the android SMS receiver APIs. Defaults to None.

  • allow_missed_call (bool, optional) – Whether this device supports receiving the code using the auth.codeTypeMissedCall method Defaults to None.

  • allow_firebase (bool, optional) – Whether Firebase auth is supported Defaults to None.

  • logout_tokens (List of bytes, optional) – List of the last logout tokens, max. 20. Defaults to None.

  • token (str, optional) – Used only by official iOS apps for Firebase auth: device token for apple push. Defaults to None.

  • app_sandbox (bool, optional) – Used only by official iOS apps for firebase auth: whether a sandbox-certificate will be used during transmission of the push notification. Defaults to None.

Returns:

SentCode – On success, an object containing information on the sent confirmation code is returned.

Raises:

BadRequest – In case the phone number is invalid.