R
R
RachelSpark2019-04-22 17:01:03
Bitrix24
RachelSpark, 2019-04-22 17:01:03

Bitrix24 Bot API, how to properly receive events via webhooks?

We need a chatbot in Bitrix that connects to the API on node.js. I use ngrok for debugging.
Through the incoming webhook, I call the imbot.register method with the following parameters:

{
    CODE: 'mynewbot',
    TYPE: 'B',
    EVENT_MESSAGE_ADD: 'https://xxxx.ngrok.io/bxchatbot',
    EVENT_WELCOME_MESSAGE: 'https://xxxx.ngrok.io/bxchatbot',
    EVENT_BOT_DELETE: 'https://xxxx.ngrok.io/bxchatbot',
    OPENLINE: 'N',
    CLIENT_ID: 'mynewbot',
    PROPERTIES: {
        NAME: 'Борис',
        LAST_NAME: '',
        COLOR: 'GRAPHITE',
        EMAIL: '[email protected]'
    }
 }

The bot ID is returned in response.
When sending a message to a bot in Bitrix, the request does not come.
Tried using outgoing webhook, changing TYPE and CLIENT_ID, still doesn't work.
Question - is it possible to make a bot through webhooks and what am I doing wrong for this? Or try using oauth?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question