integration ⏱️ 14 min

Integration of Bitrix24 with WhatsApp Business API: Sales and Support Automation

Integration of WhatsApp with Bitrix24 via API enables automated handling of incoming messages, lead creation, and improved customer support. The article covers architecture, implementation examples, and common pitfalls.

#=Bitrix24 #WhatsApp #integration #CRM #automation #API

Integration of Bitrix24 with WhatsApp Business API: Sales and Support Automation

Purpose of Integration

Integrating the WhatsApp Business API with Bitrix24 is relevant for organizations with high volumes of inbound inquiries requiring prompt responses. WhatsApp is added as an open channel, enabling centralized message processing, communication history tracking, and automation based on incoming messages.

Solution Architecture

Direct integration with the WhatsApp Business API is not possible without an intermediary backend service that handles incoming and outgoing messages via a REST interface. This layer is responsible for:

  • Message authentication and routing;
  • Formatting of text, media, and attachments to meet API requirements;
  • Webhook event processing (delivered, read, error, etc.);
  • Connecting to the Bitrix24 REST API for CRM message delivery and contact data retrieval.

The middleware may also support message queuing, API rate management, and logging.

Connecting a WhatsApp Open Channel to Bitrix24

A custom open channel is created via the Bitrix24 REST API using methods such as:

  • imopenlines.network.join – partner channel registration;
  • imbot.register and imbot.message.add – message sending and receiving via bot;
  • imconnector.XXX – when using a connector via an app.

Bitrix24 automates actions triggered by incoming messages, including responsible party assignment, automatic lead or deal creation, and logging activity in the CRM timeline.

Automation of Message Handling

Based on incoming messages, the system can automatically perform the following actions:

  • Creation of a new lead fr om unknown numbers on first contact;
  • Sales stage detection based on keywords or tags in messages;
  • Workflow initiation (e.g., task assignment to a manager or sending a notification to a supervisor);
  • Chatbot replies (e.g., sending PDFs, auto-replies, FAQs).

These operations utilize Bitrix24 Robots and Business Processes configured via a visual editor. REST requests to webhook endpoints in the middleware service are also used for sending messages or retrieving responses.

Implementation Examples

1. Handling an Incoming Message and Creating a Deal


// Webhook from WhatsApp API
$input = json_decode(file_get_contents('php://input'), true);

$phone = $input['contacts'][0]['wa_id'];
$text = $input['messages'][0]['text']['body'];

// REST request to Bitrix24 to create a lead
$leadData = [
  'fields' => [
    'TITLE' => 'WhatsApp Inquiry',
    'NAME' => 'Client',
    'PHONE' => [['VALUE' => $phone, 'VALUE_TYPE' => 'WORK']],
    'COMMENTS' => $text
  ]
];

$curl = curl_init('https://example.bitrix24.ru/rest/1/key/crm.lead.add.json');
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($leadData));
curl_exec($curl);

2. Auto-Reply


// Basic auto-reply scenario using Node.js backend
app.post('/whatsapp-inbound', async (req, res) => {
   const message = req.body.messages[0];
   const replyText = 'Thank you for reaching out. A manager will contact you shortly.';

   await sendWhatsAppMessage(message.from, replyText);
   res.sendStatus(200);
});

Common Errors

  • Sending messages without pre-approved templates – WhatsApp Business API limits outbound messages within a 24-hour session window;
  • Lack of webhook event logging results in missed inquiries;
  • Insufficient data validation may cause unintended workflow triggering;
  • Incorrect message routing between contacts and deals;
  • Queue failures during high-load messaging without retry and delay controls.

Implementation Checklist

  • Registered WhatsApp Business API account via an official provider;
  • Middleware service developed for message handling and webhook logic;
  • Message forwarding to Bitrix24 set up via REST API;
  • Integration registered as an open channel or chatbot;
  • Automation triggered by incoming messages configured;
  • Message logging enabled for debugging and audit;
  • Load testing completed for expected messaging volume;
  • API call queuing and rate lim it controls established.

FAQ

1. Can WhatsApp be used without the official API?

Use of unofficial solutions violates WhatsApp's policy and may result in account suspension. Integration via official providers is recommended.

2. What is required to activate the WhatsApp Business API?

The following are required: a verified business account, provider connection, phone number, and approval of message templates.

3. How are attachments (files, images) handled?

Media identifiers are received via webhooks. The backend downloads the media file and forwards it to Bitrix24 using disk.file.upload or a custom module.

4. Is it possible to generate a conversation report?

Message history is recorded in the CRM timeline of a deal or contact. Additional reporting can be implemented by storing messages in a local database and visualizing data through BI tools.

5. Is the integration compatible with the mobile version of Bitrix24?

Notifications, chats, and deals are accessible on mobile devices. Core automation is configured via the web interface.

Conclusion

Integrating the WhatsApp Business API with Bitrix24 delivers a high level of automation for messaging workflows, consolidates communication in a single interface, and increases operational efficiency in sales and support. Implementation requires architectural planning, accurate message routing, and adherence to API constraints, including template registration and session control. When properly deployed, such integrations significantly enhance client communication performance.


Need to review or estimate your integration?

If you're considering Bitrix24 and WhatsApp API integration, it's possible to review the scope and discuss technical or organizational constraints beforehand.

  • What use cases and automation scenarios are expected;
  • What is the expected daily volume of WhatsApp messages;
  • Are there existing workflows or configurations in Bitrix24.
Категория: integration
Время чтения: 14 min
Полезная статья?
Сохраните в закладки, чтобы не потерять
Ctrl + D