How to use telegram API codes?

i registered in https://my.telegram.org/apps and got api_hash and api_id and public key, now I want to use this function https://core.telegram.org/method/auth.sendCode

auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
---functions---
auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;

Request example

(auth.sendCode "79991234567" 1 32 "test-hash" "en")
=
(auth.sentCode
  phone_registered:(boolFalse)
  phone_code_hash:"2dc02d2cda9e615c84"
)

d16ff372 3939370b 33323139 37363534 00000001 00000020 73657409 61682d74 00006873 e77e812d
=
2215bcbd bc799737 63643212 32643230 39616463 35313665 00343863 e12b7901

how can i use this sample request?

and what are these files? ==> " d16ff372 3939370b 33323139...."

+4
source share
2 answers

You cannot send requests directly to Telegram. Creating api_hash and api_id is the basic step to get started with the Telegram API. I hope you know that Telegram uses its own protocol called "MTProto". You can get a detailed description on the official Telegram website.

Telegram " " ( ) -. . https://core.telegram.org/mtproto/samples-auth_key. API Telegram, RPC-.

https://github.com/ex3ndr/telegram-api .

- , , .

+2

Source: https://habr.com/ru/post/1607134/


All Articles