API: Authorization by call (Call-password)
go back to the main page
To send an auto-call to the client, you must send a GET request to the API URL with the following information:
- The client's phone number, in the format: 79000000000 (11 digits);
- The bot's ID.
If all variables are filled in correctly, the user will receive a call from an unknown number. The robot will dictate 4 digits, which are the confirmation code.
Also, in case of successful access to the API, a confirmation code will be sent in the response for verification on the client's website /web service.
Variables in the API URL:
{api_key} - your API key from the Personal Data section;
{phone} - the client's phone number;
{bot_id} - The ID of the bot, to link the auto-call to the history of a particular bot.
Example of a successful response (JSON):
{“status”:"1","code":"9999"}
Example of an error response (JSON):
{“status”:0, “code”:9, “error”:”not enough funds to send a call"}
Example of a PHP request:
$key = '9536b5ba8ad6c038209948d8c6b9ec47632d535e8b2457039b21582d4bae1fbd';
$phone = '79000000001';
$bot_id = 'S1-4321';
$r = file_get_contents('https://ityman.ru/api/flashcall?key='.$key.'&phone='.$phone.'&bot_id='.$bot_id);
$result = json_decode($r, true);
if($result['status'] != 1){
print 'Error: '.$result['error'];
}