leo_con | 2016-11-09 16:57:22 UTC | #1
Hi, Please: Is it posible to get the count of calls answered in less than 10 seconds , and < 20 secs
I already tried https://api.{{environment}}/api/v2/analytics/conversations/aggregates/query with this header to get count of call bettwen 0 and 10seconds, but doesn't work:
{
"interval": "2016-11-09T00:50:00.000Z/2016-11-09T23:59:59.000Z",
"metrics": [
"tAnswered"
]
,
"segmentFilters": [
{
"type": "and",
"predicates": [
{
"dimension": "queueId",
"value": "5e3c98ff-93bc-4130-a5b1-9dfd3e7a8165"
},
{
"dimension": "mediaType",
"operator": "voice"
},
{
"metric": "tAnswered",
"range": {
"gt": 0,
"lte": 10000
}
}
]}
]
}
I got 3 calls but just one was answered in less that 10 seconds:
{
"results": [
{
"group": {
"mediaType": "voice"
},
"data": [
{
"interval": "2016-11-09T00:50:00.000Z/2016-11-09T23:59:59.000Z",
"metrics": [
{
"metric": "tAnswered",
"stats": {
"max": 48904,
"count": 3,
"sum": 102359
}
}
]
}
]
}
]
}
Thank you.
tim.smith | 2016-11-09 17:21:09 UTC | #2
I'm looking into how to accomplish such a query, but I can tell you in the meantime why yours isn't working. segmentFilters is not a valid property for an aggregate query body, so it is entirely ignored. The documentation for the resource is here: POST /api/v2/analytics/conversations/aggregates/query.
tim.smith | 2016-11-09 17:32:31 UTC | #3
I've discussed this with the analytics team and your query isn't currently possible. The reason is that aggregate queries don't support metric predicate types in the query filter.
There is a new feature called "views" that will be added to the analytics APIs soon. This new feature allows you to define new metrics and use them in aggregate queries. An example would be defining a metric that matches tAnswered with a lower and upper bound; i.e. exactly what you're looking for. Keep an eye on the resource's documentation for when the "views" property is exposed to know when you can use it.
leo_con | 2016-11-09 18:12:46 UTC | #4
Thank you very much Tim, I will wait for "views" feature.
leo_con | 2016-11-29 21:08:34 UTC | #5
tim.smith, post:3, topic:597
views
Hi Tim, Please do you know when is supposed to be released "views" feature. We right now need to develop a report that requires that metric
Thank you for your support, Leonel
tim.smith | 2016-11-30 16:26:27 UTC | #6
The Analytics team is currently working on documentation and should have it published by the end of December.
system | 2017-08-28 19:28:33 UTC | #7
This post was migrated from the old Developer Forum.
ref: 597