API: Authorization go back to the main page

For the Authorization module to work correctly, the site must send confirmation codes to the API URL, individually for each phone.

For example, your new user has decided to register on the site. After entering the phone number, the site should send the following data to the API URL:

After receiving a positive response from the API, the site informs the user that he would receive a confirmation code in the Telegram bot, and then enter it in the field on the site.

The confirmation code for each number is saved for 24 hours and then deleted.

URL API
Variables in the API URL:
{api_key} - your API key from the Personal Data section;
{phone} - the client's phone number;
{code} - customer confirmation code;
{bot_id} - Bot ID.
Example of a successful response (JSON):
{“status”:1}
Example of an error response (JSON):
{“status”:0, “code”:24, “error":”API key specified incorrectly"}
Example of a PHP request:
$key = '9536b5ba8ad6c038209948d8c6b9ec47632d535e8b2457039b21582d4bae1fbd';
$phone = '79000000001';
$code = '1234';
$bot_id = 'S1-4321';
$r = file_get_contents('https://ityman.ru/api/activation?key='.$key.'&phone='.$phone.'&code='.$code.'&bot_id='.$bot_id);
$result = json_decode($r, true);
if($result['status'] != 1){
print 'Error: '.$result['error'];
}