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'];
}
Error codes:
{“status”:0, “code”:1, “error”:”Not all required fields were passed”}
{“status”:0, “code”:2, “error”:”The key is specified incorrectly”}
{“status”:0, “code”:3, “error”:”The username or password is incorrect”}
{“status”:0, “code”:4, “error”:”The account is blocked. The paid period has ended.”}
{“status”:0, “code”:5, “error”:”The bot was not found or deleted”}
{“status”:0, “code”:7, “error”:”The WhatsApp message has not been sent. The user is not registered, or the number is formed incorrectly. Only numbers in the international format are supported. Example for Russia: 79999999999.”}
{“status”:0, “code”:50, “error”:”The BOT ID field is incorrect."}
Additionally:
{“status”:1, “code”:6, “info”:”The code has been accepted, but the telegram user with this number has not been found.”}