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 bundled code). It supports multiple resources and operations, including managing access codes for companies. Specifically, the "Create New Access Code For Company" operation under the "Access Code" resource allows users to create a new access code associated with a particular company and hub.

Common scenarios where this node is beneficial include:

  • Automating security management by programmatically creating access codes for employees or contractors.
  • Integrating access control workflows into broader automation pipelines.
  • Managing access credentials centrally via API calls without manual intervention.

For example, a security administrator could use this node to generate temporary access codes for visitors or new staff members, specifying details such as the company ID, hub ID, and custom passwords.

Properties

Name Meaning
Company Id The unique identifier of the company for which the access code is being created.
Hub Id The unique identifier of the hub within the company where the access code applies.
Name A descriptive name for the access code (e.g., user or purpose).
Password The access code password consisting of 4-6 digits.
Additional Fields Optional extra parameters:
- Duress Password: An alternative 4-6 digit code used in duress situations.
- Index: Numeric index representing the access code's position or order.

Output

The node outputs JSON data representing the result of the API call to create the new access code. This typically includes details about the newly created access code such as its identifiers, status, and any metadata returned by the Ajax API.

If the node supports binary data output, it would relate to any files or attachments returned by the API, but based on the provided code and context, the primary output is structured JSON data describing the access code entity.

Dependencies

  • Requires an active connection to the Ajax API, authenticated via an API key credential configured in n8n.
  • Uses internal helper classes for HTTP communication, state management, and operation resolution.
  • No additional external dependencies beyond the Ajax API and the required API authentication token.

Troubleshooting

  • Authentication Errors: If the API key credential is missing or invalid, the node will fail to authenticate. Ensure the API key is correctly set up in n8n credentials.
  • Invalid Input Data: Missing required fields like Company Id, Hub Id, Name, or Password will cause errors. Verify all mandatory properties are provided and valid.
  • Password Format Issues: Passwords must be 4-6 digits; providing an incorrect format may lead to API rejection.
  • API Connectivity Problems: Network issues or incorrect API endpoint configuration can cause request failures. Check network connectivity and API availability.
  • Unexpected API Responses: If the API changes or returns unexpected data, the node might not handle it gracefully. Review API documentation and update the node if necessary.

Links and References

Discussion