Analytics
How to call the Analytics API to mirror Wonderboard custom charts—examples, request shapes, and parameter reference.
Use cases
Because our APIs mirror how custom charts work on the Wonderboard, the examples below are a side-by-side comparison of how to get the same results from the dashboard and from the API.
Parameters in depth
The request body combines required fields, optional filters, and per-KPI settings. Together they define:
- Which segment(s) of data to use
- Which KPI(s) to compute for that segment
- How each KPI is broken down and sorted
Full schema and the interactive playground are on the /analytics API reference page.
ProductIds (required)
The array of product IDs for which we want to retrieve the data.
Where do I get product IDs?
You can use the products endpoint to retrieve the product IDs available in your scope.
DataType (required)
Which dataset the query runs against (Feedback, Votes, or Prices).
Available data types are:
- Feedback
- Votes
- Prices
Filters
The body may include a filters array using the same syntax as elsewhere in the dashboard.
Learn more about filters in the filters section.
Configurations (required)
configurations is an array of one or more objects. Each object describes one KPI query against the same productIds, dataType, and filters. You can include up to five objects in the array to retrieve multiple KPIs in a single request.
Each configuration object has the following properties:
- kpi: the KPI to apply to the data scope that you have selected.
- breakdown: the breakdown(s) of the KPI.
- options: the options to apply to the data scope that you have selected.
When you pass more than one configuration object, productIds must contain exactly one product ID (see Validation and required values).
KPI (required)
The KPI that you wish to apply to the data scope that you have selected.
Available KPIs are:
- Feedback count
- Feedback rating
- Votes count
- Votes rating
- NPS
- Sentiment index
- TGW
- Relevance
- Subratings
Each configuration object must use a distinct KPI (no duplicates in the same request). You can provide at most five configuration objects (for the same data source).
Breakdown (required)
The breakdown is an array of a maximum of two elements, describing which breakdown the KPI should consider.
Each breakdown has the following properties:
- name: the name of the property to break down.
Supported values are the usual properties: “channel”, “continent”, “country”, “feedback property”, “nps category”, “sku”, “star value”, “time”, “topic”.
Configured channelCustomFields can also be passed here like age or skin tone.
- shortlist: use when you need to cap how many breakdown values are returned.
Accepted values are: All, TOP5, TOP10.
- values: use when you only want certain values of the breakdown.
Pass an array of strings; each entry must be a valid value for that breakdown (for example, country names for a country breakdown).
Example for country: ["Italy", "Germany", "France"].
Current limitation
At present, only one breakdown is available for the following KPIs: Subratings and Relevance.
If the KPI selected is Subratings:
- The breakdown must be subrating or time, no other breakdowns are supported
- In the breakdown by time, a subrating must be selected
Options
Optional settings are passed in the options object on each configuration.
Sort
Controls sort order for the result series.
- name:
Labelto sort by label, orValueto sort by value - order:
ASCorDESC
Sentiment
Displays series related to a specific sentiment (only available if breaking down by topic)
The admissible values are: Positive, Negative, Neutral
Timeframe
The time resolution you want the series to be aggregated with when breaking by time
The admissible values are: Week, Month, Quarter, Year
Only available in a time breakdown.
Count
For a time breakdown, whether values are instant point-in-time counts or cumulative over time.
The admissible values are: Instant, Cumulative
Only available in a time breakdown.
Ontology
The ontology type that should be considered. You can discover the available ontology types and their topic tree by calling the GET /v3/topics endpoint with the product ID.
The admissible values are: Topic, Communication & Service, Property, Component.
Ontology option is only available in a topic breakdown if it is configured in your space data scope.
Topic Level
The level of the topic to be considered. You can discover the available topic levels by calling the GET /v3/topics endpoint with the product ID.
The admissible values are numbers up to the level of topic available in your dictionary
Topic level option is only available in a topic breakdown.
Validation and required values
Requests are flexible, so the API validates inputs and returns clear errors when something is missing or inconsistent.
The main rules are:
- If you send more than one object in
configurations,productIdsmust contain exactly one product ID. - The KPI must match
dataType. For example,dataType:Feedbackwith KPI Votes count returns no data. Votes count, Votes rating, and Subratings expectdataType:Votes. - For Relevance, the endpoint returns data only if the breakdown includes topic.
- The number of breakdowns must always be at maximum 2.
- There can only be one breakdown for the following KPIs: Subratings, Relevance.
- The options timeframe and count are only available if a breakdown by time is selected.
- The options topicLevel and ontology are only available when a topic breakdown is used (including for Feedback count and Relevance).
- If the KPI selected is Relevance:
- The ontology option is required and must be compliant with the dictionary.
- In the breakdown by time, you must set at least 1 topic as value and it must exist in the dictionary.
- If the KPI selected is Subratings:
- The breakdown must be subrating or time, no other breakdowns are supported.
- In the breakdown by time, a subrating must be selected.