Magnet Customer icon

Magnet Customer

Consume Magnet Customer API

Overview

This node integrates with the Magnet Customer API to perform operations related to "Custom Field Blocks," specifically supporting a Search operation for this resource. The node allows users to query and retrieve custom field blocks, which are likely structured groups of custom fields used in CRM or customer data management scenarios.

Typical use cases include:

  • Searching for specific custom field blocks by applying filters such as feature type (e.g., contact, deal, organization, staff).
  • Paginating through large sets of custom field blocks.
  • Sorting results based on fields like email, name, or creation date.
  • Filtering blocks that have empty emails, phones, or interactions.

Practical examples:

  • A user wants to find all custom field blocks related to deals that currently have no phone numbers associated.
  • Retrieving a paginated list of custom field blocks sorted by creation date descending.
  • Searching for custom field blocks containing a specific search term in their metadata.

Properties

Name Meaning
Authentication Method of authentication to use: either API Token or OAuth2.
Page The page number of results to return when searching or getting all custom field blocks. Defaults to 1.
Limit Maximum number of results to return per request. Minimum value is 1. Defaults to 15.
Search Term Optional string to filter the search results by matching this term.
Filters Collection of optional filters to narrow down the search results:
- Feature: Filter blocks by feature type; options are Contact, Deal, Organization, Staff.
- Emails Empty: Boolean to filter blocks with empty emails.
- Phones Empty: Boolean to filter blocks with empty phones.
- Interactions Empty: Boolean to filter blocks with empty interactions.
Sort Collection specifying sorting options:
- Sort By: Field to sort by, e.g., email, name, createdAt.
- Sort Type: Direction of sorting, either Ascending or Descending.

Output

The node outputs an array of JSON objects representing the custom field blocks returned from the Magnet Customer API based on the search criteria.

Each output item corresponds to one custom field block and contains its properties as provided by the API response. The exact structure depends on the API but typically includes identifiers, names, features, and possibly metadata about the custom fields contained within the block.

No binary data output is indicated for this operation.

Dependencies

  • Requires access to the Magnet Customer API.
  • Requires configuration of credentials in n8n for authentication, either via an API token or OAuth2.
  • The node internally calls a helper function dedicated to handling requests for custom field blocks (customFieldBlockRequest).

Troubleshooting

  • Common issues:

    • Incorrect or missing API credentials will cause authentication failures.
    • Providing invalid filter values or unsupported sort fields may result in API errors.
    • Pagination parameters (page, limit) set outside allowed ranges could lead to unexpected results or errors.
  • Error messages:

    • Errors returned from the API will be caught and can be output as error messages if "Continue On Fail" is enabled.
    • Typical error messages might include authentication errors ("Invalid API key"), validation errors ("Invalid filter parameter"), or rate limiting notices.
  • Resolutions:

    • Verify that the correct authentication method and valid credentials are configured.
    • Double-check filter and sort option values against the API documentation.
    • Adjust pagination parameters to reasonable values.
    • Enable "Continue On Fail" to handle partial failures gracefully during batch processing.

Links and References


Note: This summary is based solely on static analysis of the provided source code and property definitions without runtime execution.

Discussion