Ajax icon

Ajax

Consume Ajax API (v.0.1.2)

Actions242

Overview

This node, named "Ajax," is designed to interact with the Ajax API (version indicated in the code). Specifically, for the resource "Receiver" and operation "Create Receiver For Given Company," it allows users to create a new receiver entity associated with a specified company. This is useful in scenarios where you need to programmatically manage receivers within a company's infrastructure, such as setting up new devices or endpoints that communicate with the Ajax system.

Practical examples include:

  • Automating the onboarding of new receivers when a company expands its hardware setup.
  • Integrating receiver creation into larger workflows that provision company resources.
  • Managing receiver configurations dynamically based on business logic or external triggers.

Properties

Name Meaning
Company Id The unique identifier of the company for which the receiver is being created. This is required to associate the receiver correctly.
Name The name assigned to the receiver. Helps identify the receiver within the company context.
Hub To Cms Ping Period Minutes Interval in minutes for the hub to CMS ping period. Must be divisible by 15. Defines how often the hub communicates its status to the central management system.
Use Hub Id As Account Number Boolean flag indicating whether the hub ID should be used as the account number for this receiver.
Auto Approve Hub Binding Boolean flag that applies only if "Use Hub Id As Account Number" is true. When enabled, any hub added to the company is automatically approved and mapped to this receiver.
State The operational state of the receiver. Options are: ACTIVE or INACTIVE. Determines if the receiver is currently active or not.
Protocol A collection specifying the protocol details used by the receiver. Contains at least a "Protocol Type" string field identifying the protocol discriminator.
Connections A list of connection objects bound to the receiver. Each connection includes: Host (string), Port (number), and Primary (boolean) indicating if it is the primary connection. One or two connections can be provided, but only one may be primary.

Output

The node outputs JSON data representing the result of the receiver creation operation. This typically includes details about the newly created receiver such as its identifiers, configuration, and status as returned by the Ajax API.

If the node supports binary data output, it would represent related binary content (e.g., certificates or configuration files), but no explicit binary output is indicated in the provided code snippet.

Dependencies

  • Requires an API key credential for authenticating with the Ajax API.
  • Depends on the @digital-boss/n8n-designpatterns package for response-operation resolution and execution.
  • Uses internal modules for HTTP client communication, state management, and operation handling.
  • The node expects proper configuration of the Ajax API credentials within n8n.

Troubleshooting

  • Invalid Company Id or Receiver Name: Ensure that the company ID exists and the receiver name is valid and unique within the company context.
  • Ping Period Not Divisible by 15: The "Hub To Cms Ping Period Minutes" must be a multiple of 15; otherwise, the API might reject the request.
  • Auto Approve Hub Binding Misconfiguration: If "Auto Approve Hub Binding" is set to true while "Use Hub Id As Account Number" is false, the operation may fail or ignore the auto-approve setting.
  • Connection Configuration Errors: Only one connection can be marked as primary. Having multiple primary connections or invalid host/port values could cause errors.
  • Authentication Failures: Verify that the API key credential is correctly configured and has sufficient permissions.
  • API Version Mismatch: The node uses a specific version of the Ajax API; ensure compatibility with the backend service.

Links and References


Note: The summary is based solely on static analysis of the provided source code and property definitions without runtime execution or access to private/internal credential names.

Discussion