The Gen cloud documentation(https://developer.mypurecloud.com/api/rest/v2/analytics/evaluations.html) mentions the Conversation details API endpoint can also provide the Evaluations and Surveys metrics.
Is there any query example that can help me get those?
or the only way to get them is through their own API endpoints(Evaluations aggregate and Surveys aggregate)?
A basic query to start of with for retrieving Evaluations and Surveys metrics from the /api/v2/analytics/conversations/details/query
endpoint is
{
"interval": "2020-10-01T00:00:00.000Z/2020-11-01T00:00:00.000Z",
"surveyFilters": [
{
"type": "or",
"predicates": [
{
"dimension": "surveyId",
"operator": "exists"
}
]
}
],
"evaluationFilters": [
{
"type": "or",
"predicates": [
{
"dimension": "evaluationId",
"operator": "exists"
}
]
}
]
}
The api-explorer and analytics-query-builder are helpful tools for building complex queries. The schema for that particular endpoint can be found here.
Thanks Ronan!
I wanted to get all the conversations in a interval which had surveys and/or evaluations and the ones without them.
I tried two different queries.
{
"interval": "2020-10-01T00:00:00.000Z/2020-10-02T00:00:00.000Z",
"order": "asc",
"orderBy": "conversationStart",
"paging": {
"pageSize": 100
}
}
This gave me conversations without Evaluations or Surveys.
Second query
{
"interval": "2020-10-01T00:00:00.000Z/2020-10-02T00:00:00.000Z",
"order": "asc",
"orderBy": "conversationStart",
"paging": {
"pageSize": 100
},
"surveyFilters": [
{
"type": "or",
"predicates": [
{
"dimension": "surveyId",
"operator": "exists"
}
]
}
]
}
This gave me only those conversations which had evaluations. All the conversations were exclusive of the previous query.
Also, how should be the paging set up to get all the pages and conversations at once?
The first query you tried should give surveys and evaluations because there is no filter applied that could remove any results.
The second query will only return data if surveys exist during that interval. There may be evaluations and conversations in the response if they happened also during the interval.
For this particular endpoint, you'll have to use the pageNumber
value to page through the responses. The usual way to do it is start with a pageNumber of 1 and append the responses onto an object while sending requests with an increasing pageNumber until you get an empty response.
ok.
Seems that the pages might help me get all the data I am missing from the first query.
Will try that out.
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.