Queue Agent Membership Endpoint

Hello
I am working on a analytics use case where I need how long an agent is member of a queue and how long an agent is idle, on call etc. Have a couple of questions.
a) To get the membership, is the endpoint /api/v2/routing/queues/{id}/users correct ? But, I need to iterate over all queues. I may hit rate limit. Any better approach ?

In my browser, when I inspect I could see that start and dates are passed via ININ-Client-Path. I don't see that param in API. Can you check ?

b) Can I get the data for historical data starting from Jan 2020 ?

Hi,

  1. That endpoint has recently been deprecated. /api/v2/routing/queues/{queueId}/members is the current endpoint. There is no better approach but the Python SDK will automatically handle rate limits.
    If you need to maintain the state of queue membership, you can use this tutorial as a guide to cache queue membership. The tutorial has been implemented in Java but the concept is the same.

  2. I'm not sure where that call is being made to because I can't see any reference to ININ-Client-Path in the API schema.

  3. The POST /api/v2/analytics/users/aggregates/query can be used to get IDLE time.
    The following request would get the agent's idle time since Jan 2020. This value is not per-queue since routing status is not tied to the queue.

{
"interval": "2020-01-00T00:00:00.000Z/2021-05-28T23: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
  }
}

Thanks for the reply @anon11147534.

  1. I want to listen to all membership changes continuously. It seems like the program runs and exits right but once the program exists how do i listen to other events ?
  2. Also, what about historical membership changes ? Does this code take a daterange as a parameter ?

Hi,

  1. The program I linked in the tutorial above will stay running until the process is terminated.
  2. No, unfortunately there's no way to get historical queue membership.

Hello,

  1. I think you should be able to get historical membership changes using the Audits API.
    See here for Sample Usage.

Regards,

@anon11147534
I want to know the timestamp of NotificationEvent i.e when agent joined/left the queue. Don't see it coming now, can you help me finding the timestamp ?

There isn't a timestamp on that event so your best bet is to use your application to capture the time the event is received at.

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