Skip to main content

Bitrix24

Bitrix24 is a CRM whose automation rules (robots) run when a lead or a deal enters a stage. One of them, the webhook robot, calls an address. Given the Flows address with the phone and the name of the contact in its parameters, it starts your flows: a new lead, a deal paid or shipped — and the customer gets the right message in Viber or SMS, with a reminder if nothing happens.

Written from Bitrix24 documentation

This page is written from the public documentation of Bitrix24 and has not been checked on a live account yet.

What you need​

  • Access to the robots of the CRM. Which plans include robots is not confirmed by the documentation. Outbound webhooks are not available in demo mode; the on-premise edition needs the REST module and an active license.
  • One robot per stage, each with its own event. All of them use the same address.
  • The robot passes the values of fields in the parameters of the address. The Bitrix24 documentation describes only the address field of the robot; putting field values into the address is known from the community, not from the documentation. Check the first test request carefully.

Step 1. Create a connection​

  1. Open Flows → Connections, press Connect a system and choose Bitrix24.
  2. Press Copy address. It looks like https://events.alphasms.net/hooks/<TOKEN> — keep it secret.

Step 2. Add a robot in Bitrix24​

  1. Open CRM → Deals (or Leads) → Automation rules and choose the stage that should start a flow — a new lead, your "paid" or "shipped" stage.

  2. Add the automation rule Outbound webhook.

  3. In the field Handler paste the address from the cabinet and add the parameters:

    <address from the cabinet>?b24_id=<ID>&event=deal_stage_changed&phone=<contact phone>&name=<contact name>&stage=<deal stage>&ts=<current date>

    The parts in angle brackets are values of fields. Insert them with the button to the right of the field; that the field Handler has this button is not confirmed by the documentation.

  4. event is a constant — the AlphaFlow event of this stage: lead_submitted for a lead; deal_stage_changed, order_paid, order_shipped or another one for a deal (see Events).

  5. Add more if you need them: email (the contact's email), contact_id (the contact's ID), amount (the amount), title (the name of the deal), ttn (the field with the tracking number).

  6. Save the robot.

  • Keep b24_id, event and phone as they are: by them AlphaFlow recognises Bitrix24.
  • Do not leave out ts: without it the same deal entering the same stage again is taken for a repeat.

Step 3. Send a test​

Move a test deal whose contact has your own phone number to the stage with the robot. The event appears in Flows → Connections → Event journal within seconds, and the connection shows Recognised: Bitrix24. The connection also shows the last request as it came: check that the phone and the name arrived whole.

Events​

Robot in Bitrix24AlphaFlow event (event)Properties
On the stage of a new leadlead_submitteddeal_id, title
On a stage of a dealdeal_stage_changeddeal_id, stage, title, total
On your "paid" stageorder_paiddeal_id, total
On your "shipped" stageorder_shippeddeal_id, ttn

order_created, order_status_changed, order_delivered and order_cancelled are taken the same way. deal_id is the value of b24_id, total — of amount. The contact is found by phone, email and contact_id, the first name comes from name. For deal_stage_changed and order_status_changed the value of stage can also be turned into another event by the status table of the connection, which is empty at first. The names of the events are the ones the ready-made templates expect — see Recommended events.

A name like order_paid or order_shipped goes only into the robot of that very stage: order_paid — only into the robot of your "paid" stage, never into a robot copied to every stage. The robots of the other stages send deal_stage_changed with stage: otherwise a deal moved to another stage reaches the customer as "paid".

Without a robot​

The plain outbound webhook of Bitrix24 (Developer resources → Common use cases → Other → Outbound webhook, one event per webhook, for example ONCRMDEALUPDATE) sends only the id of the deal — no phone and no name. Such an event cannot reach a person and is refused with no_contact. Use the robot.

Good to know​

  • Values go into the address as they are; their encoding is not described. A + in the phone becomes a space — AlphaFlow does not mind, it takes the digits. But & or # in a name or a title break the address.
  • The phone field of a contact can hold several numbers. Two of them may come in one line, and their digits merge.
  • The Bitrix24 documentation does not describe repeats of the robot. The robot does not sign its requests; the secret in the address is enough.
  • The tracking number is passed as the ttn property, like any other: AlphaFlow does not track the parcel.
  • The address always answers 200. Above the daily event limit the event is refused in AlphaFlow with quota_exceeded and shown in the journal; the robot in Bitrix24 stays on.

Bitrix24 documentation​