Commanders Act icon

Commanders Act

Use the Commanders Act API

Actions108

Overview

This node integrates with the Commanders Act API, specifically supporting various resources and operations related to data privacy, consent management, event delivery, and more. For the Cookie Scanner resource with the Get JS Code operation, it retrieves the JavaScript code snippet that can be embedded into a legal or cookie notice page on a website. This code automatically builds the cookie list table for visitors, helping website owners comply with cookie consent regulations by dynamically displaying cookie information.

Practical scenarios include:

  • Automatically generating and updating cookie consent banners or tables on websites.
  • Integrating with legal pages to ensure compliance with privacy laws like GDPR.
  • Fetching the latest JavaScript code from Commanders Act to embed in web pages without manual updates.

Properties

Name Meaning
Query Parameters A collection of optional query parameters to customize the API request. Includes fields such as:
- end: End date/time filter.
- Fields[template]: Template field selection.
- filter: JSON object for complex filtering criteria (e.g., date ranges, search terms, segment IDs).
- granularity: Level of data granularity.
- include: Additional data to include.
- page: Pagination details in JSON format.
- sort: Sorting options, either JSON or string depending on context.
- source, start, token: Other filters or authentication tokens as needed.

The property "Query Parameters" allows flexible customization of the API call by adding any supported parameters recognized by the Commanders Act API endpoint.

Output

The node outputs an array of JSON objects representing the response from the Commanders Act API. For the Get JS Code operation under the Cookie Scanner resource, the output JSON contains the JavaScript code snippet as returned by the API. This snippet is intended to be embedded directly into a webpage.

If the API returns a string, the node attempts to parse it as JSON; if parsing fails, it returns the raw text. If no content is returned, it outputs a status message indicating "204 No Content".

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to the Commanders Act API.
  • Requires valid API credentials including a site identifier and an API token.
  • The node uses HTTP requests to the Commanders Act API base URL: https://api.commander1.com/v2.
  • Proper configuration of credentials in n8n is necessary to authenticate API calls.

Troubleshooting

  • Missing Credentials Error: If API credentials are not set or invalid, the node will throw an error indicating missing credentials. Ensure the API key/token and site ID are correctly configured.
  • Required Parameter Missing: For some operations, required parameters like Cookie Notice Version ID or Cookie ID must be provided. Omitting these will cause errors.
  • API Request Failures: Network issues, incorrect parameters, or expired tokens may cause API call failures. Check the error message for details and verify connectivity and credentials.
  • Parsing Errors: If the API returns unexpected data formats, the node might fail to parse the response. Review the raw response for troubleshooting.

Links and References


This summary focuses on the Cookie Scanner resource and the Get JS Code operation, describing how the node fetches the JavaScript code snippet for embedding cookie consent functionality on websites.

Discussion