Vinay | 2017-06-12 14:36:03 UTC | #1
Hi I wanted to retrieve one-day queue data like name and max wait time.please guide me which API I have to use and what are the procedure I have to follow.
tim.smith | 2017-06-12 14:44:51 UTC | #2
Vinay, post:1, topic:1398
retrieve one-day queue data like name
You can get static information about queues using GET /api/v2/routing/queues or GET /api/v2/routing/queues/{queueId} if you know the ID of the queue.
Vinay, post:1, topic:1398
max wait time
To retrieve the max wait time, use POST /api/v2/analytics/conversations/aggregates/query with a filter predicate for the queue you're interested in and grouped by tWait. The tWait statistic's max value will show you the maximum value for the stat across the results that match your query's criteria. Here's an example query:
{
"interval": "2017-06-12T06:00:00.000Z/2017-06-13T06:00:00.000Z",
"groupBy": [
"queueId"
],
"filter": {
"type": "or",
"predicates": [
{
"type": "dimension",
"dimension": "queueId",
"operator": "matches",
"value": "636f60d4-04d9-4715-9350-7125b9b553db"
}
]
},
"metrics": [
"tWait"
]
}
You can use the Developer Tools Analytics Query Builder to easily design your queries and then translate them into SDK requests.
Vinay | 2017-06-13 12:21:15 UTC | #3
Hii Tim, while using the above-mentioned query I am getting 400 error. below find the query which I am using and the screenshot of the error.
{
"interval": "2017-01-01T10:57:44-05:00/2017-01-02T10:57:44-05:00",
"groupBy": [
"queueId"
],
"filter": {
"type": "or",
"predicates": [
{
"type": "dimension",
"dimension": "queueId",
"operator": "matches",
"value": "b1c0d337-ffc7-4580-8312-14491c1e6676"
}
]
},
"metrics": [
"tWait"
]
}
<img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/646f48b1f44853181c8d21cfc132271851fbe3f8.PNG" width="690" height="372">
tim.smith | 2017-06-13 13:39:17 UTC | #4
The 400 you're getting is being caused by your interval not being evenly divisible by 30 minutes. Try changing it to 2017-01-01T10:00:00-05:00/2017-01-02T10:00:00-05:00 and it should work.
edit: This function should be improved to allow more granularity in the future. This improvement is being tracked as AR-4263.
system | 2017-08-28 19:35:00 UTC | #5
This post was migrated from the old Developer Forum.
ref: 1398