Data queries
Data queries extract data from Medallia Experience Cloud records. The API has different root nodes depending on the type of data (such as feedback or invitations).
The query has the general structure described in Query API. The power of the query is in the Data section.
Of particular note is the fieldData
parent entity which represents the data for a given field. When you combine the fieldData
with the GraphQL "… on
" Query fragments operator, you can extend the field data and get more specific data. Because Medallia Experience Cloud data type can have their own schemas, use inline fragments to explore the graph on each dataType
.
alias: fieldData(fieldId:”field_identifier”){
… on stringEnumFieldData{
options{
id
name
}
}
}
Queries return up to 30 results unless you specify a different limit (page size) with the first
parameter. See Pagination for details and examples of retrieving "pages" of results instead of all results. Pagination improves performance and makes the results manageable.
Pulling record-level data
It is of paramount importance that anyone consuming the Query API knows its data. This API provides a mechanism to query metadata of each field, and this feature should be used by developers to know exactly how they should use the fields in the queries.
Use the detailed info about each field to build your queries and extract data from Experience Cloud.
The API has different root nodes for querying record-level feedback, invitations, and contact information.
Data sources
Data sources are the different sets of records from which we are going to fetch or aggregate record-level data values which have a direct link with the record type survey.
In Experience Cloud, measurements are made by analyzing feedback from various signals (surveys, social media, conversations). Each signal is one interaction, and each interaction is a response.
Internally, each response is stored as a survey record regardless of the source.
When a GraphQL operation exposes record-level fields, the data source is the first node of the query, to declare which is the subset of the data we need to retrieve.
These nodes allow you to fetch raw Experience Cloud data to display Medallia scores on TV or intranet, or show reports in BI dashboards (e.g. Power BI, Tableau) with advanced filtering options for aggregate and record-level data.
Invitations
Feedback can be solicited with invitations. Invitations are messages to participate in providing feedback. An invitation is a message inviting the customer to give us feedback about an event (an interaction between the customer and your company).
This data source includes all invitations and it also comprises completed surveys (feedback).
Feedback
This data source only includes completed surveys (the set of surveys with status COMPLETED, EXCLUDED, and AUTOEXCLUDED). It is a subset of the invitations
data source, designed to make it easier to query only for feedback (i.e. completed) records.
To see sample feedback queries, see Pulling feedback data.
Feedback and Text Analytics
Text Analytics processes text feedback based on defined topics to derive themes that identify sentiment, and calculate impact scores.
Comment fields can be expanded on to retrieve TA information.
Customer profiles
Customers can be known, or they can be anonymous:
Known – Name, email, phone number and other demographics such as company loyalty status.
Unknown – No personal information is available, only that they gave feedback.
A profile is the collection of known information about a specific customer, gathered over time. Use Query API to fetch customer information by requesting the customerSchema
and customer
nodes.
For more detailed information about the use of these nodes to consolidate useful data, see Pulling profile information.
Aggregation operations
There are two aggregation operations available in Query API: Aggregate
, aggregateTable
and they require a definition of the data sources to be used in the query. There are additional data sources for aggregations that are not available for record-level queries.
These options are:
FEEDBACK – The data sets for aggregation operations regarding feedback are the same as the previously mentioned
feedback
data set.INVITATIONS – The data sets for aggregation operations regarding invitations are the same as the previously mentioned
invitations
data set.FEED_FILES – A processing report which is generated after a feed file is processed.
SSO_EVENT_STATS – A survey record used to store statistics about SSO (single sign-on) events.
SURVEY_EXPORT_STATS – A survey record created to store the results and stats of a single execution of a survey export.
USER_ACTIVITIES – Records that contain end-user activity information like page views or workflow paths.
Note: Most of these definitions are imported from thee_survey_type
record field values.
Translations
Medallia Experience Cloud supports using multiple languages for assets such as questions and choice sets from surveys, emails, reports, and survey takers' comments. You can translate the text into as many languages as your company needs.
Query API can return the translated text strings from these assets. You can pass an Accept-Language
header so the API returns the output in the specified language, provided a translation of the text strings in that language exists. When there is no translation available, the text strings in the response will be in the source language, which is English by default.
To specify the desired target language in the header, use the 2- or 3-character ISO-639 code as shown in the following examples:
Example: Accept-Language
header set to English (en)
Example: Accept-Language
header set to German (de)
Examples: Interactive
You can explore the repositories and find examples that can inspire you on how to write queries for different use cases.