How to get overall mediatype response (Without a specific mediatype grouping) for aggregate query

Hi,
Please advise how to get the response for overall mediatype instead of mediatype specific grouping. For example I want to get the overall tTalkComplete metric by Queues only but I am getting a result which is always grouped by mediaType even though I am not requesting that grouping in my request.
I am calling this url: /api/v2/analytics/conversations/aggregates/query
And my Request is:


And i am getting below response
{
"results": [
{
"group": {
"direction": "outbound",
"divisionId": "a6543d5f-e092-452a-8a87-f88716b36ad5",
"mediaType": "voice",
"queueId": "0bf2c7fa-bff6-40fd-a0ce-4fdfa2225fe0"
},
"data": [
{
"interval": "2021-02-17T02:00:00.000Z/2021-02-17T02:30:00.000Z",
"metrics": [
{
"metric": "nConnected",
"stats": {
"count": 4
}
}
]
}
]
},
{
"group": {
"direction": "inbound",
"divisionId": "a6543d5f-e092-452a-8a87-f88716b36ad5",
"mediaType": "voice",
"queueId": "174176d3-eee7-4c74-9dbd-60c1871c5885"
},
"data": [
{
"interval": "2021-02-17T06:30:00.000Z/2021-02-17T07:00:00.000Z",
"views": [
{
"name": "tshortAbandon",
"stats": {
"max": 9691,
"min": 9691,
"count": 1,
"sum": 9691
}
}
]
}
]
}
]
}

But I want the overall response which is not for a specific mediatype but for all the mediatypes altogether. Please note in the request i am not grouping by mediatype, but still the response is grouped by mediatype. How can i achieve this. Please let know. Thanks

Thanks
Salma

Hi,

There's 2 ways to go about this:

  1. Process the returned data in group it into separate objects for each mediaType
  2. Adding a filter for the specific mediaType and calling the API with the filter applied for every mediaType.

The analytics-query-builder is helpful for building these queries.

Hi Ronan,
Thanks for your response.
See what i am basically interested is, if am not grouping by anything in the request query then whey my response is grouped by mediatype like shown below. In this example this response is for mediatype chat only and is grouped by mediatype, whereas i did not specify any grouping in my request. I dont want the response to be grouped by mediatype, to achieve that what should i do. Please kindly advise. Thanks

Hello,

As far as I know, the conversation aggregate request always groups by mediaType by default - whether you specify it in your request or not.
There is currently no way around this at this time.

You can request new features and share your use case at https://genesyscloud.ideas.aha.io/
Or you can process the results in your javascript code (making the sum/count/average for all the mediaTypes).

Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.