Bitrix24 icon

Bitrix24

Work with Bitrix24 API

Overview

This node integrates with the Bitrix24 CRM system to manage Lead records. Specifically, the "Get" operation for the "Lead" resource allows users to retrieve a single lead record either by its unique ID or by applying custom filter criteria on lead fields.

Common scenarios where this node is beneficial include:

  • Fetching detailed information about a specific lead when you know its ID.
  • Searching for a lead based on certain attributes (e.g., name, status, email) without knowing the ID.
  • Selecting only specific fields of the lead to optimize data usage and processing.

Practical example:

  • You have a workflow that triggers when a new email arrives, and you want to check if the sender is already a lead in Bitrix24. Using the "Get" operation with a filter on the email field, you can retrieve the matching lead's details to decide further actions.

Properties

Name Meaning
Get By Choose how to get the lead: by "ID" (unique identifier) or by "Filter" (custom conditions on lead fields).
ID The unique identifier of the lead record to retrieve. Required if "Get By" is set to "ID".
Filter Fields A collection of filter conditions to find the lead. Each filter includes:
- Field Name: The lead field to filter by.
- Operation: Comparison operator such as Equals, Not Equals, Greater Than, Contains, etc.
- Value: The value to compare against. Required if "Get By" is set to "Filter".
Select Fields List of lead fields to retrieve. If empty, a default set of fields will be returned. This helps limit the output to only necessary data.

Output

The node outputs an array of JSON objects representing lead records matching the query. For the "Get" operation:

  • When getting by ID, the output contains one lead object with the requested fields.
  • When getting by filter, it returns the first matching lead object or an error message if no match is found.

Each lead object includes key-value pairs corresponding to the selected fields from Bitrix24. There is no binary data output for this operation.

Example output snippet:

[
  {
    "ID": "123",
    "NAME": "John Doe",
    "EMAIL": "john.doe@example.com",
    "STATUS_ID": "NEW"
  }
]

If no lead matches the filter, the output will contain:

[
  {
    "error": "Запись не найдена"
  }
]

("Record not found" in Russian)

Dependencies

  • Requires a valid Bitrix24 API authentication token configured in n8n credentials.
  • Needs the Bitrix24 webhook URL to access the CRM API endpoints.
  • Uses HTTP POST requests to Bitrix24 REST API endpoints for leads.
  • The node dynamically loads available lead fields from Bitrix24 to populate options.

Troubleshooting

  • Missing Credentials or Webhook URL: The node throws errors if the API credentials or webhook URL are not set or invalid. Ensure these are correctly configured.
  • Invalid ID or No Matching Record: If the specified lead ID does not exist, or the filter yields no results, the node returns an error message indicating the record was not found.
  • Filter Syntax Errors: Incorrect filter operations or values may cause the API call to fail or return no results. Verify filter conditions carefully.
  • API Rate Limits or Network Issues: Temporary failures in connecting to Bitrix24 may occur; retry or check network connectivity.
  • Field Selection Issues: Selecting fields that do not exist or are misspelled may result in incomplete data or errors.

Links and References

Discussion