Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare API, specifically supporting multiple resources including the Metrics API. The "List Mappings" operation under the Metrics API resource retrieves a list of all mappings for a project. Mappings in Contentsquare typically represent configurations or groupings used to organize and analyze user behavior data.

Use cases include:

  • Fetching available mappings to understand how data is segmented or grouped within a project.
  • Automating workflows that require dynamic retrieval of mapping configurations before further analysis or reporting.
  • Integrating mapping data into dashboards or other analytics tools.

Example: You want to get all mappings for a project to display them in a report or use their IDs for subsequent metric queries.

Properties

Name Meaning
Query Parameters A collection of optional filters and parameters to refine the request.

The Query Parameters collection supports these options:

Parameter Name Meaning
device Device filter for analysis. Options: All, Desktop, Mobile, Tablet
endDate End of date range for analysis (must be after startDate)
format Start date of the query date range
frequency Filter based on export frequency
from Filter based on export format
goalId Return conversion metrics for a non-ecommerce goal (number)
ids Comma-separated list of segment IDs to filter results
limit Max number of results to return (minimum 1, default 50)
metricType Metric type to retrieve. Options: Quantile, Average
order Order of results. Options: Ascending, Descending
page Page number of results to retrieve
period Granularity of results. Options: Daily, None
projectId Target project ID (required only for account-level API key)
quantile Percentile for quantile metric type (default 75, ignored if metricType is Average)
scope Filter based on scope
segmentIds Multiple segments separated by commas to get intersection metrics
startDate Beginning of date range for analysis (must be before endDate)
state Filter based on status
to End date of the query date range

Output

The output is a JSON array containing the response from the Contentsquare API endpoint /v1/mappings with applied query parameters.

  • The structure depends on the API response but generally includes an array of mapping objects with details such as mapping IDs, names, and related metadata.
  • If the API returns no content, the node outputs a status code message indicating "204 No Content".
  • The node does not output binary data for this operation.

Dependencies

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

Troubleshooting

  • Missing Credentials Error: If Client ID or Client Secret are missing, the node throws an error. Ensure credentials are correctly set up.
  • Access Token Retrieval Failure: If the OAuth token cannot be obtained, check network connectivity and credential validity.
  • Required Parameter Missing: For this operation, no mandatory parameters are strictly enforced, but providing correct project context may be necessary.
  • API Errors: Any API call failure will throw an error with the message prefixed by "Error calling Contentsquare API". Check the API response and ensure query parameters are valid.
  • Empty Response: If the API returns no data, the node outputs a "204 No Content" status; verify that the query parameters match existing data.

Links and References

Discussion