Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare API, specifically supporting multiple resources and operations including the Data Export API. The "List Export Jobs" operation under the Data Export API resource retrieves a list of all export jobs available in the Contentsquare platform.

This operation is useful for users who want to programmatically access and manage their data export jobs, enabling automation of data workflows such as monitoring export job statuses, auditing exports, or triggering downstream processes based on export job metadata.

Practical example:
A marketing analyst could use this node to fetch all export jobs related to user behavior data, filter them by status or date range, and then trigger further analysis or reporting workflows automatically within n8n.

Properties

Name Meaning
Query Parameters A collection of optional filters and parameters to refine the list of export jobs returned. These include:
- Device: Filter by device type (All, Desktop, Mobile, Tablet)
- End Date: End of date range for analysis (must be after start date)
- Format: Filter based on export format
- Frequency: Filter based on export frequency
- From: Filter based on export format (seems similar to Format, possibly a different context)
- Goal ID: Return conversion metrics for a non-ecommerce goal
- IDs: Comma-separated list of segment IDs to filter results
- Limit: Maximum number of results to return (minimum 1, default 50)
- Metric Type: Choose between Quantile or Average metric types
- Order: Order of results, Ascending or Descending (default Descending)
- Page: Page number of results to retrieve
- Period: Granularity of results, Daily or None (default None)
- Project ID: Target project identifier (required only for account-level API keys)
- Quantile: Percentile value used if metric type is Quantile (default 75)
- Scope: Filter based on scope
- Segment IDs: Multiple segments separated by commas to retrieve intersection metrics
- Start Date: Beginning of date range for analysis (must be before end date)
- State: Filter based on status
- To: End date of query date range (appears redundant with End Date)

Output

The output is a JSON array where each item corresponds to an export job matching the query parameters. The structure of each JSON object depends on the API response from Contentsquare's export jobs endpoint and typically includes details such as:

  • Export job identifiers
  • Status and state of the export job
  • Creation and update timestamps
  • Associated project or scope information
  • Other metadata relevant to the export job

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

No binary data output is produced by this operation.

Dependencies

  • Requires valid Contentsquare API credentials including:
    • Client ID
    • Client Secret
    • Project ID (optional depending on API key scope)
    • Scope string for OAuth token request
  • The node performs OAuth2 client credentials flow to obtain an access token.
  • Network access to https://api.contentsquare.com is required.
  • Proper configuration of the credential in n8n with the above details is necessary.

Troubleshooting

  • Missing Credentials: If Client ID or Client Secret are not provided, the node throws an error "Missing Client ID or Client Secret."
  • Authentication Failure: If the OAuth token cannot be retrieved, errors like "Failed to retrieve access token" or "Failed to retrieve endpoint" occur.
  • Required Parameter Missing: For some operations, missing required parameters (e.g., Job ID) will cause errors specifying which parameter is missing.
  • API Errors: Any HTTP or API errors are caught and rethrown as node errors with messages prefixed by "Error calling Contentsquare API:" followed by the original error message.
  • Empty or Invalid Response: If the API returns empty or invalid JSON, the node attempts to parse it; if parsing fails, it returns raw text or a 204 status message.

To resolve these issues:

  • Ensure all required credentials and parameters are correctly set.
  • Verify network connectivity and API endpoint availability.
  • Check that query parameters conform to expected formats and constraints (e.g., date ranges).
  • Review API limits or permissions associated with the API key.

Links and References

  • Contentsquare API Documentation (general reference for API endpoints and usage)
  • OAuth2 Client Credentials Flow (standard OAuth2 authentication method used)
  • n8n Documentation on HTTP Request Node and Credential Setup (for configuring API credentials)

Discussion