Bitrix24 icon

Bitrix24

Interact with Bitrix24 CRM and business platform

Actions290

Overview

This node allows users to make direct calls to the Bitrix24 REST API, enabling flexible interaction with any Bitrix24 resource or method not covered by predefined operations. It supports multiple authentication methods including OAuth2, webhook URLs, and API keys.

Common scenarios where this node is beneficial include:

  • Accessing Bitrix24 API endpoints that are newly introduced or rarely used.
  • Performing custom queries or actions on Bitrix24 CRM entities like leads, contacts, deals, tasks, etc.
  • Automating complex workflows by calling specific Bitrix24 API methods directly.
  • Fetching paginated data from list endpoints with control over how many pages to retrieve.

Practical example:

  • Calling crm.lead.list endpoint to fetch a list of leads with custom filters.
  • Creating a new task by calling tasks.task.add with a JSON body describing the task.
  • Updating a contact by calling crm.contact.update with the contact ID and fields to update.

Properties

Name Meaning
Authentication Method to authenticate API requests:
- OAuth2: Recommended for production use.
- Webhook: Uses a Bitrix24 webhook URL; simpler but less secure.
- API Key: Uses an API key for authentication.
Method The Bitrix24 REST API endpoint to call, specified without domain or auth parts. Examples: crm.lead.list, user.get, tasks.task.list. This defines which API method will be invoked.
Body JSON object representing the request body to send with the API call. Example: { "FIELDS": { "TITLE": "New Lead", "NAME": "John" } }. Used to pass parameters or data required by the API method.
Return All Boolean flag indicating whether to return all results when calling .list endpoints (which support pagination). If false, only up to the limit defined by Max pages to load will be returned.
Max pages to load Number specifying the maximum number of pages to load for .list operations if Return All is false. Each page typically contains 50 items. Limits the amount of data fetched to avoid excessive API calls.
Options Collection of additional options:
- Debug Mode: Enables detailed logging of request and response data for troubleshooting purposes.

Output

The node outputs an array of items where each item contains a json property holding the parsed JSON response from the Bitrix24 API call.

  • The structure of the json output depends entirely on the called API method and its response format.
  • For .list operations, the output will contain the list of entities retrieved, potentially aggregated across multiple pages if Return All is enabled.
  • If the API returns binary data (not typical for Bitrix24 REST API), it would be included in the binary output field, but this node primarily handles JSON responses.

If an error occurs during execution and the node is configured to continue on failure, the output will include an item with an error field describing the issue, along with the resource name and timestamp.

Dependencies

  • Requires valid Bitrix24 credentials depending on the chosen authentication method (OAuth2 token, webhook URL, or API key).
  • The node internally uses a helper function to make standard Bitrix24 API calls.
  • No external libraries beyond those bundled with n8n are required.
  • Proper configuration of credentials in n8n is necessary for successful API communication.

Troubleshooting

  • Common issues:

    • Incorrect or expired authentication credentials leading to authorization errors.
    • Malformed JSON in the Body property causing API request failures.
    • Specifying invalid or unsupported API endpoints.
    • Exceeding API rate limits imposed by Bitrix24.
    • Pagination settings not matching the expected API behavior, resulting in incomplete data retrieval.
  • Error messages:

    • Errors returned from Bitrix24 API will be surfaced in the node's output if "Continue On Fail" is enabled.
    • Typical error messages include authentication failures, invalid method names, missing required fields, or quota exceeded.
  • Resolutions:

    • Verify and refresh authentication credentials.
    • Validate JSON syntax in the Body input.
    • Confirm the API endpoint string matches Bitrix24 documentation.
    • Adjust pagination settings or enable Return All carefully.
    • Enable Debug Mode to get detailed request/response logs for diagnosing issues.

Links and References

Discussion