Ajax icon

Ajax

Consume Ajax API (v.0.1.2)

Actions242

Overview

The node named "Ajax" is designed to interact with a backend Ajax API (version indicated in the code). It supports multiple resources and operations, including the "Device" resource with the "Get Devices List" operation. This operation retrieves a list of devices associated with a specific user and hub.

Common scenarios for this node include:

  • Fetching device inventories for a given user within a particular hub.
  • Integrating device data into workflows for monitoring or management purposes.
  • Enriching device information by optionally requesting additional details.

For example, a user might use this node to get all devices connected to their smart home hub or to retrieve devices assigned to an employee in an enterprise environment.

Properties

Name Meaning
User Id The identifier of the user whose devices are to be listed.
Hub Id The identifier of the hub from which to retrieve the devices.
Additional Fields Optional fields to customize the request; currently supports: Enrich (boolean) to enrich device data with more details.

Output

The output of the node is a JSON object containing the list of devices retrieved from the backend API. Each device entry typically includes device-specific information such as identifiers, status, and metadata. If the "Enrich" option is enabled, the device data may contain additional detailed attributes.

If the node supports binary data output, it would represent device-related files or media, but based on the provided code and properties, the primary output is structured JSON data representing devices.

Dependencies

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

Troubleshooting

  • Missing or invalid credentials: Ensure that the API key credential is correctly configured and has sufficient permissions.
  • Invalid User Id or Hub Id: Verify that the provided identifiers exist and are correct; otherwise, the API may return empty results or errors.
  • Network issues: Check connectivity to the Ajax API endpoint.
  • API changes: Since the node relies on a specific version of the Ajax API, incompatible API updates could cause failures.
  • Enrich option misuse: If enrichment is requested but not supported for certain devices, partial data may be returned.

Common error messages might include authentication failures, resource not found, or malformed request errors. Resolving these typically involves verifying input parameters and credentials.

Links and References

Discussion