Ajax icon

Ajax

Consume Ajax API (v.0.1.2)

Actions242

Overview

This node, named "Ajax," is designed to interact with a specific Ajax API (version indicated in the code). It provides a flexible interface to perform various operations on multiple resources within the Ajax system. The particular operation of interest here is "Get All Object Media By Object Id" under the Object resource.

In this operation, the node retrieves all media items associated with a given object identified by its unique Object Id within a specified company context. This is useful for scenarios where you need to fetch all related media files (such as images, videos, or documents) linked to an object entity managed in the Ajax platform.

Practical examples include:

  • Fetching all surveillance camera footage or snapshots linked to a security object.
  • Retrieving all media attachments related to a monitored device or asset.
  • Aggregating media data for reporting or audit purposes based on object identifiers.

Properties

Name Meaning
Company Id The unique identifier of the company under which the object exists.
Object Id The unique identifier of the object whose associated media you want to retrieve.

Both properties are required inputs for the operation and must be provided as strings.

Output

The node outputs JSON data containing the collection of media items associated with the specified object. Each item in the output typically includes metadata about the media such as URLs, types, timestamps, or other relevant attributes depending on the Ajax API's response structure.

If the node supports binary data output (e.g., actual media files), it would represent these as binary attachments linked to the JSON output, but this is not explicitly detailed in the provided source.

Dependencies

  • Requires an API key credential for authenticating requests to the Ajax API.
  • Depends on the HttpClient class from the bundled backend code to make HTTP requests.
  • Utilizes internal state management and operation resolution utilities from the included design patterns package.
  • The node expects proper configuration of the API credentials within n8n to function correctly.

Troubleshooting

  • Missing or invalid credentials: Ensure that the API key credential is correctly configured and has sufficient permissions to access the requested resource.
  • Invalid Company Id or Object Id: Verify that the provided IDs exist and are correctly formatted; otherwise, the API may return errors or empty results.
  • Network or API errors: Check network connectivity and API availability. Common error messages might indicate timeouts or unauthorized access.
  • Operation not supported: If the operation or resource names are misspelled or unsupported, the node will fail to resolve the correct method.

To resolve errors, confirm input parameters, validate credentials, and review API documentation for any changes or limitations.

Links and References

  • Ajax API Documentation (general reference for Ajax API)
  • n8n Documentation on Creating Custom Nodes
  • Relevant GitHub repository or package for @digital-boss/n8n-designpatterns if available publicly for deeper understanding of used utilities

Discussion