Ajax icon

Ajax

Consume Ajax API (v.0.1.2)

Actions242

Overview

The node named "Ajax" is designed to interact with the Ajax API, specifically version 1 as indicated. It supports multiple resources and operations, including the "Hub" resource with an operation called "Execute Power Test Command." This operation allows users to send a power test command (turning it ON or OFF) to a specific hub within a company.

Common scenarios for this node include:

  • Managing and testing power states of hubs in a security or automation system.
  • Automating power tests on devices remotely via the Ajax API.
  • Integrating Ajax device management into broader workflows for monitoring or maintenance.

For example, a user might automate turning on a power test mode on a hub before performing diagnostics or turn it off after completing maintenance.

Properties

Name Meaning
Company Id The unique identifier of the company that owns the hub.
Hub Id The unique identifier of the hub on which the power test command will be executed.
Power Test The power test command to execute; options are "ON" to enable the power test or "OFF" to disable it.

Output

The node outputs JSON data representing the response from the Ajax API after executing the requested operation. This typically includes confirmation of the command execution status, any returned data about the hub's state, or error messages if the command failed.

If the node supports binary data output, it would relate to any binary content returned by the Ajax API, but based on the provided code and properties, the primary output is JSON structured data reflecting the API response.

Dependencies

  • Requires an API key credential for authenticating with the Ajax API.
  • Depends on the external Ajax API service being available and reachable.
  • Uses internal helper classes for HTTP communication, state management, and operation resolution/execution.
  • No additional environment variables or n8n configurations beyond providing valid credentials for the Ajax API are indicated.

Troubleshooting

  • Authentication errors: If the API key credential is missing, invalid, or expired, the node will fail to authenticate. Ensure the correct API key is configured.
  • Invalid IDs: Providing incorrect or non-existent Company Id or Hub Id values will likely result in errors or no action. Verify these identifiers before running the node.
  • Unsupported power test values: Only "ON" or "OFF" are valid for the Power Test property. Using other values may cause errors.
  • Network issues: Connectivity problems to the Ajax API endpoint can cause timeouts or failures. Check network access and API availability.
  • API errors: The Ajax API may return errors due to rate limits, permissions, or internal server issues. Review the error messages returned in the node output for guidance.

Links and References

  • Ajax API Documentation (general reference for the Ajax API)
  • n8n documentation on creating custom nodes
  • Relevant sections of the bundled source code for understanding operation methods and HTTP client usage (not publicly linked)

Discussion