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, providing various operations across multiple resources. Specifically, for the Hub resource and the Control Hub Arm State operation, it allows users to remotely control the arming state of a security hub device. This includes commands such as arming, disarming, and toggling night mode on or off.

Typical use cases include:

  • Automating security system management in smart buildings.
  • Integrating security hub controls into broader automation workflows.
  • Remotely changing the security state based on external triggers or schedules.

For example, a user could set up a workflow that disarms the hub when an authorized user arrives home or arms it automatically at night.

Properties

Name Meaning
User Id The identifier of the user performing the command; required to specify who initiates the action.
Hub Id The identifier of the specific hub device whose arm state is being controlled.
Command The action to perform on the hub's arm state. Options: ARM, DISARM, NIGHT_MODE_ON, NIGHT_MODE_OFF.
Ignore Problems A boolean flag indicating whether to ignore any problems or errors during execution.

Output

The node outputs JSON data representing the result of the control command sent to the hub. This typically includes confirmation of the command execution status, any updated state information of the hub, and possibly error details if the command failed.

If the node supports binary data output (not explicitly shown here), it would relate to any raw response data from the API, but this is not indicated in the provided code.

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 API.
  • Utilizes internal modules for managing state and resolving/executing operations.
  • Needs proper configuration of the API credentials within n8n to function correctly.

Troubleshooting

  • Common Issues:

    • Invalid or missing User Id or Hub Id can cause the API call to fail.
    • Incorrect or expired API authentication token will prevent successful communication.
    • Sending unsupported commands or malformed parameters may result in errors.
    • Network connectivity issues can lead to timeouts or unreachable API endpoints.
  • Error Messages:

    • Authentication errors typically indicate invalid credentials; verify and update the API key.
    • Validation errors suggest missing or incorrect input properties; ensure all required fields are filled correctly.
    • API response errors might include detailed messages from the backend; review these to adjust inputs or handle exceptions.

Links and References

Discussion