info@garnet-lab.com
РУССКИЙ
+7 495 414 18 36

3 minutes

Site integration with Bitrix24 CRM

Автор статьи

Глеб Антоненко

Possible ways of integration

  • Bitrix24 CRM forms
  • Integration through the standard features of Bitrix: Site Management (SMS)
  • Integration through standard features of other CMS systems (for example, Tilda)
  • Integration via Bitrix24 REST API (web hook/application)

Integration Method Selection Algorithm

The first thing we do: we determine on which CMS system the site was developed. This can be seen by analyzing the source code of the site page. Or by asking the experts who support the site. If this is a BUS, then we use the built-in possibilities for integrating forms with CRM. If this is another CMS, then first we look for the standard CMS features for integration with Bitrix24. If we don’t find it, then we use CRM forms or integration via the REST API. If this is a site without a CMS (self-written), then CRM forms are used or integration via the REST API.

CMS (engine) site
Built-in CMS features
CRM forms
REST API (webhook)
Bitrix: Site Management
✅ (Preferred)
other CMS systems
Google “integration of [CMS name] Bitrix24”
self-written website (no CMS)
✅ (Preferred)

BUS integration with B24

See here

Integration via CRM forms

See here

Integration via REST API

If we chose integration via REST, then we need to determine which entities we create. Most often these are leads or deals. Further on the example of leads.

Creating a webhook in Bitrix24.Made by the portal administrator (integrator)

 
‼️
Line employees should not create webhooks and local applications on their own. The point is that the webhook receives the authorization (access rights) of the user who created it. And, if this user is eventually fired or demoted, then the webhook will become inoperable. You need to write the webhook as a user with administrator privileges (best as the main administrator with ID = 1). Most often, an integrator is involved in creating web hooks.

In the section Market - Developers - Other - select Incoming webhook.

Be sure to give a “speaking” name (pencil to the right of the name).

We give rights to the CRM module.

We pass the line in the “Webhook to call the rest api” field to the developer who will integrate the site with Bitrix24.

How to use REST API via webhook.Made by website developer

Check out the documentation

Main:

Additional Information:

To test and debug REST methods for the Bitrix24 portal, you can install and use an extremely convenient application from the Market"REST API Documentation". You can run REST methods directly from it.

Learn to call REST methods from your programming environment

The Bitrix24 REST interface allows you to call methods using either GET requests (passing data in the request URL) or POST requests (passing data in the request body). It is recommended to use POST requests, because they can use the modern JSON format to pass the request data. The general scheme of a request to REST:

  • POST method
  • required headerContent-Type: application/json
  • Request URL:[webhook address]/[REST method name]
  • request body in JSON format

Example: Retrieving Company Data

Request:

curl -X POST -H "Content-Type: application/json" -d '{"id": 4118}' https://garnet-lab.bitrix24.ru/rest/8/3y1izgza84c03xxl/crm.company.get

Answer:

{"result":{"ID":"4118","COMPANY_TYPE":null,"TITLE":"Тестовая компания","LOGO":null,"LEAD_ID":null,"HAS_PHONE":"Y","HAS_EMAIL":"N","HAS_IMOL":"N","ASSIGNED_BY_ID":"1","CREATED_BY_ID":"1","MODIFY_BY_ID":"1", ...

How to create leads with webhooks

The procedure for creating leads in Bitrix24 will require the following REST methods:

Method name
Purpose
Link to Documentation
crm.duplicate.findbycomm
Search for existing contacts in CRM and company by phone number and email
crm.lead.add
Lead creation

1. We are looking for an existing contact and company by phone number / email

For what? If an email and/or phone number was specified in the form on the site, then it is necessary to find the existing contact and company in order to avoid duplication of these entities during the further conversion of the lead by the manager. We use the methodcrm.duplicate.findbycomm. An example call is contained in the documentation. The method will return the found contacts and companies, which must be specified when creating a lead in the next step. If nothing is found by email and phone, this is normal - you do not need to specifically create a contact or company.

2. Create a lead

We use the methodcrm.lead.add. An example call is contained in the documentation. We indicate the values of the CONTACT_ID and COMPANY_ID fields found in the previous step (if several contacts / companies were found, then select the first ones).

A list of all available standard fields in leads can be found here:https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_fields.php

It is also possible to fill in custom fields (starting with UF_*).

Have questions or need to find a solution to Your problem?

Leave a request by filling out the feedback form. Our expert will contact you as soon as possible