The module allows you to call API methods for integration with third systems. To run the script, we need call_node method.

Call format:

POST <https://engine>.{{project slug}}.kwizbot.io/kw/api/call_node/ or

Where:

Calls the execution of the script from the entry point (see Components for details) specified in the call for the user with the specified chat_id of the specified channel.

This screenshot shows the entry point with the alias crm_entry_point

This screenshot shows the entry point with the alias crm_entry_point

JSON request format (JSON body):

{
"chat_id":"398866372",
"channel":"telegram",
"bot_id":1,
"connector_alias":"crm_entry_point",
"data":{
	"phone":"380961234567",
	"name":"Sergey"
	}
}

Where:

Response format:

{
    "status": "error" или "success" 
    "message": "сообщение с ответом",
    "data": {...данные ответа...} 
}

Curl-request example:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://{{engine-url}}/kw/api/call_node/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"chat_id":"999999999",
"channel":"telegram",
"bot_id":1,
"connector_alias":"node_alias",
"data":{
"phone":"380111111111",
"name":"Randomname"
},
"callback_url": "[<https://callback-getter.site>](<https://callback-getter.site/>)"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>