Agent Stats Idle, Talk, ACW

I'm trying to find an API call that provides me agent statistics for a range by queue. I've found a way to get talk and acw but I can't find idle time. This is for an outbound dialing queue. If someone could point me in the right direction I should be able to run with it but if anyone has a built example that would be great.

To get idle time, use POST /api/v2/analytics/users/aggregates/query. The tAgentRoutingStatus metric will have a member for the IDLE routing status, if the user was in that routing status for the interval. PureCloud does not tabulate status per queue, however, since routing status is not tied to the queue.

Here's a query you could use to get that data:

{
"interval": "2017-01-06T07:00:00.000Z/2017-01-07T07:00:00.000Z",
 "groupBy": [
  "userId"
 ],"metrics": ["tAgentRoutingStatus"],
 "filter": {
  "type": "or",
  "predicates": [
   {
    "type": "dimension",
    "dimension": "userId",
    "operator": "matches",
    "value": "9ed7d9f6-0c59-4360-ac54-40dd35eb9c2f"
   }
  ]
 }
}

And the result set will contain a member like this:

{
  "metric": "tAgentRoutingStatus",
  "qualifier": "IDLE",
  "stats": {
    "sum": 92272
  }
}

Also please note that talk and ACW are conversation-level concepts. If an agent can work multiple queues and/or if an agent can handle multiple concurrent interactions (e.g. three ACD routed web chats), these concepts don't really jive at a per-user-level (e.g. all three chats could be in very different states at once). This is a part of the motivation for these data elements being exposed over separate API endpoints.

So all that being said, "idle" is a user-aggregated concept whereas talk+acw are conversation-level and so I advise caution about combining the concepts.