Commanders Act icon

Commanders Act

Use the Commanders Act API

Actions108

Overview

This node integrates with the Commanders Act API to manage web container variables, specifically allowing users to create web datalayer variables. It is useful in scenarios where you want to programmatically add or update variables that are part of a website's data layer for tag management and analytics purposes. For example, marketers or developers can automate the creation of custom data layer variables to track user interactions or page metadata without manual intervention.

Properties

Name Meaning
Query Parameters A collection of optional query parameters to customize the API request. Includes fields like end, filter, granularity, page, sort, source, start, and a password-protected token. These parameters allow filtering, sorting, pagination, and other request customizations.
Request Body JSON object representing the body of the API request. This contains the details of the web datalayer variable to be created.

Output

The node outputs the JSON response from the Commanders Act API after creating the web datalayer variable. The output structure corresponds directly to the API's response, typically including details about the newly created variable such as its ID, name, type, and configuration. If the API returns no content, the node outputs a status code indicating "204 No Content". The node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating with the Commanders Act API.
  • The base URL used for requests is https://api.commander1.com/v2.
  • The node expects valid credentials configured in n8n to access the API.
  • The node uses standard HTTP methods (POST for creation) and JSON payloads.

Troubleshooting

  • Missing Credentials: If the API credentials are not set or invalid, the node will throw an error indicating missing credentials.
  • Required Parameters Missing: The node validates required IDs and parameters based on the operation. For this operation, ensure the request body is correctly formatted JSON; otherwise, parsing errors may occur.
  • API Errors: Any errors returned by the Commanders Act API will be wrapped and reported with the message "Error calling Commanders Act API" along with the original error message and stack trace if available.
  • Invalid JSON in Request Body: Since the request body is parsed from a JSON string, invalid JSON will cause the node to fail. Validate JSON syntax before running the node.
  • Unexpected Response Format: If the API returns a non-JSON string, the node attempts to parse it; failure results in returning the raw text.

Links and References

Discussion