Views: 2446
Last Modified: 13.05.2022
Gets chat ID
Attention! restCommand function is used here for illustration purposes only. It is taken from the
EchoBot example. You can send a REST command with your own function, or use the
BX24.callMethod or
bitrix24-php-sdk methods.
Method call
$result = restCommand('imbot.chat.get', Array(
'ENTITY_TYPE' => 'OPEN', // Arbitrary entity ID (for example CHAT, CRM, OPENLINES, CALL and etc.), can be used for chat search and easy context definition in the following event handlers: ONIMBOTMESSAGEADD, ONIMBOTMESSAGEUPDATE, ONIMBOTMESSAGEDELETE (req.)
'ENTITY_ID' => 13, // Numerical entity ID; it can be used for chat search and easy context definition in the following events handlers: ONIMBOTMESSAGEADD, ONIMBOTMESSAGEUPDATE, ONIMBOTMESSAGEDELETE (req.)
'BOT_ID' => 39, // Chatbot ID from which the request is sent. May not be specified, if there is only one chatbot
), $_REQUEST["auth"]);
Required fields :
ENTITY_TYPE
- arbitrary entity ID (for example CHAT, CRM, OPENLINES, CALL and etc); it can be used for chat search and for easy app context definition in the event handlers ONIMBOTMESSAGEADD, ONIMBOTMESSAGEUPDATE, ONIMBOTMESSAGEDELETE.
ENTITY_ID
- numeric entity ID; it can be used for chat search and for easy app context definition in the event handlers ONIMBOTMESSAGEADD, ONIMBOTMESSAGEUPDATE, ONIMBOTMESSAGEDELETE.
Return:
Returns: returns chat ID CHAT_ID
or null
.