SendConfirmPhoneCodeRequest

Only users can use this request. See code examples.

---functions---
account.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode

Returns

auth.SentCode

This type can be an instance of either:

SentCodeSentCodeSuccess

Parameters

hashstring
settingsCodeSettings

Known RPC errors

This request can cause 1 known error:

HashInvalidErrorThe provided hash is invalid.

You can import these from telethon.errors.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.account.SendConfirmPhoneCodeRequest(
        hash='A4LmkR23G0IGxBE71zZfo1',
        settings=types.CodeSettings(
            allow_flashcall=True,
            current_number=True,
            allow_app_hash=True,
            allow_missed_call=True,
            allow_firebase=True,
            unknown_number=True,
            logout_tokens=[b'arbitrary\x7f data \xfa here'],
            token='some string here',
            app_sandbox=False
        )
    ))
    print(result.stringify())