Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node interacts with the Contentsquare API, specifically supporting multiple resources including the Data Export API. For the Data Export API resource and the List Job Runs operation, it retrieves a list of all job runs associated with a specific export job identified by its Job ID.

This operation is useful when you want to monitor or audit the execution history of data export jobs in Contentsquare. For example, you might use it to:

  • Track the status and results of scheduled export jobs.
  • Retrieve metadata about each run such as timestamps, success/failure states, or output details.
  • Automate workflows that depend on the completion or outcome of export jobs.

Properties

Name Meaning
Job ID The unique identifier of the export job whose runs you want to list. This is required for this operation.
Query Parameters A collection of optional filters and pagination controls to refine the list of job runs returned. Options include:
- Device Filter by device type: All, Desktop, Mobile, Tablet.
- End Date End date of the date range filter (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, likely a different parameter).
- Goal ID Return conversion metrics for a non-ecommerce goal (number).
- IDs Comma-separated list of segment IDs to filter results.
- Limit Maximum number of results to return (default 50, minimum 1).
- Metric Type Metric aggregation type: Quantile or Average. Default is Quantile.
- Order Sort order of results: Ascending or Descending (default Descending).
- Page Page number of results to retrieve (for pagination).
- Period Granularity of results: Daily or None (default None). Can only be used if date range is larger than one day.
- Project ID Target project ID (required only for account-level API keys).
- Quantile Percentile value for quantile metric type (default 75). Ignored if metric type is Average.
- Scope Filter based on scope (string).
- Segment IDs Multiple segment IDs separated by commas to get intersection metrics (number).
- Start Date Start date of the date range filter (must be before End Date).
- State Filter based on job run status (string).
- To End date of the query date range (string).

Output

The node outputs an array of JSON objects representing the job runs retrieved from the Contentsquare API. Each object corresponds to a job run and contains details as provided by the API response, which typically includes metadata such as run identifiers, timestamps, statuses, and possibly result summaries.

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

No binary data output is indicated for this operation.

Dependencies

  • Requires valid credentials for the Contentsquare API, including a Client ID, Client Secret, and optionally a Project ID and Scope.
  • The node performs OAuth2 client credentials flow to obtain an access token before making API requests.
  • Network connectivity to https://api.contentsquare.com is required.
  • Proper configuration of the API credentials within n8n is necessary.

Troubleshooting

  • Missing Credentials: If the Client ID or Client Secret is missing, the node will throw an error "Missing Client ID or Client Secret."
  • Invalid or Expired Token: Failure to retrieve an access token will cause an error "Failed to retrieve access token".
  • Missing Job ID: Since Job ID is required for listing job runs, omitting it will cause an error "Job ID is required".
  • API Errors: Any HTTP or API errors are caught and rethrown with a message prefixed by "Error calling Contentsquare API:" along with the original error message.
  • Empty Responses: If the API returns empty or no content, the node outputs a "204 No Content" status object.
  • Incorrect Query Parameters: Providing invalid or incompatible query parameters (e.g., endDate before startDate) may cause API errors; ensure date ranges and filters are valid.

Links and References


This summary focuses exclusively on the Data Export API resource and the List Job Runs operation as requested.

Discussion