Contentsquare icon

Contentsquare

Use the Contentsquare API

Actions76

Overview

This node integrates with the Contentsquare API, specifically supporting multiple resources including the Speed Analysis API. For the Speed Analysis API resource and the Get Scenario HAR From Analysis operation, the node retrieves the HTTP Archive (HAR) data from a scenario analysis. This HAR data represents detailed network request and response information captured during performance testing of web pages or scenarios.

Use cases include:

  • Analyzing detailed page load and resource timing data for specific user scenarios.
  • Diagnosing performance bottlenecks by examining network requests in detail.
  • Benchmarking web page speed and behavior under different conditions or devices.

For example, you might use this node to fetch HAR data after running a speed test scenario on your website to understand which resources are slowing down page load times.

Properties

Name Meaning
Query Parameters A collection of optional filters and parameters to refine the analysis query. Includes options such as Device type (All, Desktop, Mobile, Tablet), date ranges (Start Date, End Date), pagination (Page, Limit), ordering (Ascending, Descending), metric types (Quantile, Average), and others. These parameters help specify exactly which data to retrieve from the analysis.
Request Body JSON object sent as the POST request body. This allows sending additional data required by the API endpoint for the operation.

The Query Parameters collection supports these notable options (among others):

  • Device: Filter results by device type.
  • Start Date / End Date: Define the date range for the analysis.
  • Limit: Maximum number of results to return.
  • Metric Type: Choose between "Quantile" or "Average".
  • Order: Sort results ascending or descending.
  • Page: Specify the page number for paginated results.

Output

The node outputs the response from the Contentsquare API call as JSON data. For the "Get Scenario HAR From Analysis" operation, this JSON contains the HAR data representing the recorded network activity of the analyzed scenario.

  • The output JSON structure corresponds directly to the API's HAR response format, typically including details like request URLs, timings, headers, and payloads.
  • If the API returns no content, the node outputs a status code message indicating "204 No Content".
  • The node does not explicitly handle binary data for this operation; all data is returned as JSON.

Dependencies

  • Requires an API authentication token obtained via OAuth2 client credentials flow using a Client ID and Client Secret.
  • Needs a valid project identifier and appropriate API scope configured in the credentials.
  • The node makes HTTPS requests to the Contentsquare API endpoints.
  • Proper configuration of the API credentials in n8n is necessary before use.

Troubleshooting

  • Missing Credentials: Errors will occur if the Client ID or Client Secret are missing. Ensure these are correctly set in the node credentials.
  • Access Token Retrieval Failure: If the node cannot obtain an access token, verify that the credentials and scopes are correct and that the API service is reachable.
  • Required Parameter Missing: Some operations require mandatory parameters (e.g., Job ID, Page Group ID). Omitting these will cause errors. Check error messages for missing parameter names.
  • API Endpoint Errors: Network issues or invalid parameters may cause API errors. Review the error message returned by the node for details.
  • Invalid JSON in Request Body: The request body must be valid JSON. Malformed JSON will cause request failures.

Links and References

Discussion