MadelineProtoDocs/old_docs/API_docs_v70/methods/auth.sendCode.md
2019-12-27 18:25:37 +01:00

2.9 KiB

title description image
auth.sendCode You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png

Method: auth.sendCode

Back to methods index

You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info)

Parameters:

Name Type Description Required
allow_flashcall Bool You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) Optional
phone_number string You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) Yes
current_number Bool You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) Optional
api_id int You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) Yes
api_hash string You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) Yes

Return type: auth.SentCode

Can bots use this method: NO

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$auth.SentCode = $MadelineProto->auth->sendCode(['allow_flashcall' => Bool, 'phone_number' => 'string', 'current_number' => Bool, 'api_id' => int, 'api_hash' => 'string', ]);

Or, if you're into Lua:

auth.SentCode = auth.sendCode({allow_flashcall=Bool, phone_number='string', current_number=Bool, api_id=int, api_hash='string', })

Errors

Code Type Description
400 API_ID_INVALID API ID invalid
400 API_ID_PUBLISHED_FLOOD This API id was published somewhere, you can't use it now
400 INPUT_REQUEST_TOO_LONG The request is too big
400 PHONE_NUMBER_APP_SIGNUP_FORBIDDEN You can't sign up using this app
400 PHONE_NUMBER_BANNED The provided phone number is banned from telegram
400 PHONE_NUMBER_FLOOD You asked for the code too many times.
400 PHONE_NUMBER_INVALID The phone number is invalid
400 PHONE_PASSWORD_PROTECTED This phone is password protected
400 SMS_CODE_CREATE_FAILED An error occurred while creating the SMS code
406 PHONE_NUMBER_INVALID The phone number is invalid
406 PHONE_PASSWORD_FLOOD You have tried logging in too many times