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 supports multiple resources and operations, including the "Object" resource with an operation to "Create Object Media For Object Id." The node facilitates uploading or associating media (such as images) with an existing object identified by its ID within a company context.

Common scenarios include:

  • Adding images or media files to objects stored in a system, such as attaching photos to inventory items, assets, or records.
  • Categorizing media with captions and predefined categories like "ROAD_MAP" or "FLOOR_PLAN."
  • Automating media uploads linked to objects during workflows that manage company data.

Practical example:

  • A user wants to upload a floor plan image to a building object in their asset management system. They provide the company ID, the object ID of the building, specify which input property contains the image data, and optionally add a caption and category. The node then sends this media to the backend via the Ajax API.

Properties

Name Meaning
Company Id The unique identifier of the company under which the object exists.
Object Id The unique identifier of the object to which the media will be attached.
Image Data Property Name The name of the input property that contains the image data to be uploaded.
Additional Fields Optional extra fields for the media:
- Caption A text caption describing the media.
- Category The category of the media; options are "ROAD_MAP" or "FLOOR_PLAN".

Output

The node outputs JSON data representing the result of the media creation operation. This typically includes confirmation details from the Ajax API about the newly created media associated with the specified object. The exact structure depends on the API response but generally contains identifiers, status, and metadata of the uploaded media.

If the node handles binary data (image files), it uses the specified input property to read the image content, but the output JSON focuses on metadata and operation results rather than raw binary data.

Dependencies

  • Requires an active connection to the Ajax API service.
  • Needs an API authentication token or key credential configured in n8n to authorize requests.
  • Depends on internal modules for HTTP communication, state management, and operation resolution.
  • No external environment variables beyond standard API credentials are explicitly required.

Troubleshooting

  • Missing or invalid credentials: Ensure the API key or authentication token is correctly set up in n8n credentials for the Ajax API.
  • Invalid Company Id or Object Id: Verify that the provided IDs exist and are correct; otherwise, the API may return errors indicating not found or unauthorized access.
  • Incorrect Image Data Property Name: The property name must match exactly the input containing the image data; otherwise, the node cannot find the image to upload.
  • Unsupported category values: Only "ROAD_MAP" and "FLOOR_PLAN" are valid categories; using other values may cause validation errors.
  • API errors: Network issues or server-side problems can cause failures; check connectivity and API status.

Links and References

Discussion