Commanders Act icon

Commanders Act

Use the Commanders Act API

Actions83

Overview

This node integrates with the Commanders Act API, specifically providing functionality to manage various resources including the Cookie Scanner. The "Reset Cookie Description" operation under the Cookie Scanner resource resets a cookie's description to its default value as configured in the system for the specified cookie name and languages.

This operation is useful when you want to revert any custom changes made to a cookie's description back to the original default description provided by Commanders Act. For example, if a cookie's description was manually edited but you want to restore the standard description for compliance or clarity, this operation automates that reset.

Practical scenarios include:

  • Maintaining accurate and standardized cookie descriptions on your website.
  • Quickly reverting unintended or incorrect edits to cookie descriptions.
  • Ensuring descriptions are consistent across multiple languages as configured.

Properties

Name Meaning
Cookie Name The exact name of the cookie whose description you want to reset to the default. This is required to identify which cookie's description will be restored.
Query Parameters Optional additional parameters to customize the API request. These include various filters, pagination, sorting options, date ranges, and tokens. Examples: end, filter[begin_date], page, sort, token (API token).

The "Query Parameters" collection supports many optional fields such as:

  • Date filters (filter[begin_date], filter[end_date], etc.)
  • Pagination and sorting controls (page, sort)
  • Other filtering criteria like device, location, segment IDs, etc.
  • A token parameter for authentication or session control

Output

The output is a JSON array where each element corresponds to the response from the API call for each input item processed.

  • The JSON output contains the API response data after resetting the cookie description.
  • If the API returns a string, it attempts to parse it as JSON; otherwise, it outputs the raw text.
  • If no content is returned (HTTP 204), the output includes a status code message indicating "204 No Content".
  • There is no binary data output for this operation.

Dependencies

  • Requires an active connection to the Commanders Act API.
  • Requires valid API credentials (an API key/token) configured in n8n to authenticate requests.
  • The base URL used is https://api.commander1.com/v2.
  • The node uses HTTP methods (GET, POST, PATCH, PUT, DELETE) depending on the operation.
  • Proper permissions on the Commanders Act account to perform cookie scanner operations.

Troubleshooting

  • Missing Credentials Error: If the API credentials are not set or invalid, the node throws an error "Missing Commanders Act API Credentials". Ensure you have configured the API key/token correctly in n8n credentials.
  • Required Parameter Missing: If the "Cookie Name" property is empty when performing the reset operation, the node throws an error "Cookie Name is required". Make sure to provide the exact cookie name.
  • API Errors: Any errors returned by the Commanders Act API are wrapped and thrown as node errors with messages like "Error calling Commanders Act API: [error message]". Check the API response and ensure the cookie name exists and the user has permission.
  • Invalid Query Parameters: Providing malformed or unsupported query parameters may cause API errors. Validate the parameters according to the API documentation.
  • No Content Response: If the API returns no content, the node outputs a status message "204 No Content" indicating the operation succeeded but no data was returned.

Links and References

Discussion