Ajax icon

Ajax

Consume Ajax API (v.0.1.2)

Actions242

Overview

This node, named "Ajax," is designed to interact with a comprehensive Ajax API (version indicated in the code). It supports multiple resources and operations, including controlling the arm state of a hub for a company. The node is useful in scenarios where users need to programmatically manage security hubs—arming, disarming, or toggling night mode—across different companies and hubs within an organization.

Practical examples include:

  • Automatically arming a security hub when employees leave the office.
  • Disarming the hub remotely during business hours.
  • Enabling or disabling night mode based on time schedules or events.

Properties

Name Meaning
Company Id Identifier of the company owning the hub. Required to specify which company's hub to control.
Hub Id Identifier of the specific hub device to control.
Command The action to perform on the hub's arm state. Options: ARM, DISARM, NIGHT_MODE_ON, NIGHT_MODE_OFF.
Ignore Problems Boolean flag indicating whether to ignore problems during command execution (true/false).

Output

The node outputs JSON data representing the result of the requested operation on the hub's arm state. This typically includes confirmation of the command execution status, any error messages if applicable, and possibly updated state information of the hub.

If the node supports binary data output, it would relate to any raw response or logs from the Ajax API, but this is not explicitly shown in the provided code snippet.

Dependencies

  • Requires an API key credential for authenticating with the Ajax API service.
  • Depends on the HttpClient class for making HTTP requests to the backend Ajax API.
  • Utilizes internal modules for managing state and resolving/executing resource-operation methods.
  • Needs proper configuration of the API credentials within n8n to function correctly.

Troubleshooting

  • Common Issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrect companyId or hubId values may lead to "not found" errors or failed commands.
    • Using unsupported commands or malformed input parameters can result in validation errors.
  • Error Messages:

    • Authentication errors: Ensure the API key credential is correctly set up and valid.
    • Resource not found: Verify that the specified company and hub IDs exist and are accessible.
    • Command rejected: Confirm that the command value is one of the supported options (ARM, DISARM, NIGHT_MODE_ON, NIGHT_MODE_OFF).

Resolving these usually involves checking the input parameters, verifying API credentials, and ensuring the target devices are properly registered in the system.

Links and References

Discussion