Views: 1598
Last Modified: 13.05.2022

Deletes chatbot from the system

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.

Note: For chatbots to work properly, access to marta.bitrix.info shall be authorized from Bitrix24 account or site.

CLIENT_ID parameter shall be specified for all methods to work with chatbots via Webhooks. Such code shall be unique for each chatbot.

Method call

$result = restCommand('imbot.unregister', Array(

    'BOT_ID' => 39 // Bot numerical ID 
    'CLIENT_ID' => '', // Chatbot string ID, used only in Webnooks mode

), $_REQUEST["auth"]);

Attention! Все чаты один-на-один данного чат-бота с пользователями будут утеряны.

Return:

true or error.

Related links:

REST API - Installation and Update Events

Possible error codes:

Code Description
BOT_ID_ERROR Chatbot not found.
APP_ID_ERROR Chatbot is not part of this application: you can only work with chatbots, installed within application framework.



Courses developed by Bitrix24