Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare API, specifically supporting multiple resources including Data Export API, Metrics API, and Speed Analysis API. For the Data Export API resource and the List Exportable Fields operation, it retrieves all fields that can be extracted for a specified scope from the Contentsquare platform.

This is useful when you want to programmatically discover which data fields are available for export in your Contentsquare project, enabling dynamic configuration of export jobs or data analysis workflows.

Practical example:
You might use this node operation to fetch exportable fields before creating an export job, ensuring you select valid fields for your data extraction needs.

Properties

Name Meaning
Query Parameters A collection of optional filters and parameters to refine the list of exportable fields. These include:
- Device: Filter by device type (All, Desktop, Mobile, Tablet)
- End Date: End of date range for analysis
- Format: Start date of the query date range
- Frequency: Filter based on export frequency
- From: Filter based on export format
- Goal ID: Return conversion metrics for a non-ecommerce goal
- IDs: Filter segments by comma-separated IDs
- Limit: Max number of results to return (default 50)
- Metric Type: Quantile or Average
- Order: Ascending or Descending
- Page: Page number of results
- Period: Granularity of results (Daily or None)
- Project ID: Target project (required for account-level API key)
- Quantile: Percentile for quantile metric type (default 75)
- Scope: Filter based on scope
- Segment IDs: Comma-separated segment IDs for intersection metrics
- Start Date: Beginning of date range for analysis
- State: Filter based on status
- To: End date of query date range

Output

The output is a JSON array where each item represents an exportable field retrieved from the Contentsquare API. The exact structure depends on the API response but typically includes details about each field such as its name, type, description, and possibly other metadata relevant to exporting data.

If the API returns no content, the node outputs a status message indicating "204 No Content".

No binary data output is involved in this operation.

Dependencies

  • Requires an API authentication token obtained via OAuth2 client credentials flow using:
    • Client ID
    • Client Secret
    • Optional Project ID and Scope
  • The node makes HTTP requests to the Contentsquare API endpoint.
  • Proper n8n credentials setup for the Contentsquare API is necessary.

Troubleshooting

  • Missing Client ID or Client Secret: The node will throw an error if these credentials are not provided.
  • Failed to retrieve access token or endpoint: Indicates issues with authentication or API availability.
  • Required parameters missing: For some operations, required IDs (e.g., Job ID, Page Group ID) must be provided; otherwise, errors occur.
  • API errors: Any error returned by the Contentsquare API will be wrapped and reported with the message "Error calling Contentsquare API" along with the original error message.
  • Empty or malformed responses: If the API returns empty or non-JSON responses, the node attempts to handle them gracefully but may output raw text or a 204 status message.

Links and References


This summary focuses on the Data Export API resource and the List Exportable Fields operation as requested.

Discussion