Genesys Cloud - Main

 View Only
Discussion Thread View
Expand all | Collapse all

In-Queue Agent Count

  • 1.  In-Queue Agent Count

    Posted 04-18-2018 11:16
    I want to know how to tell in Architect whether there are any active agents.
    I do not care if they are on the phone, just if they could potentially answer a call.

    ------------------------------
    Jeff Buzhardt
    MicroAutomation, Inc.
    ------------------------------


  • 2.  RE: In-Queue Agent Count

    Posted 04-19-2018 14:30
    While that feature would be incredibly useful, it doesn't exist. At least, not yet.

    Someone please tell me I'm wrong. Been wanting to find that feature for the last year.

    ------------------------------
    Patrick Rada
    Keypath Education LLC
    ------------------------------



  • 3.  RE: In-Queue Agent Count

    GENESYS
    Posted 04-19-2018 15:08
    We are also very keen to get this feature underway. We want to start development on this in H2 and are just waiting to release some higher priority features first then we will be able to work on this.

    ------------------------------
    Rebecca Owens
    PureCloud Self-Service Product Manager
    ------------------------------



  • 4.  RE: In-Queue Agent Count

    Posted 10-10-2019 13:25
    Any luck on this? This is something that would help route calls intelligently and give the best customer experience!

    ------------------------------
    Rich Calligan
    Hearing Help Express, Inc.
    ------------------------------



  • 5.  RE: In-Queue Agent Count

    Posted 04-26-2018 18:59
    Hi Jeff,

    This API may help /api/v2/analytics/queues/observations/query, if you build a custom data action using this API, it can return "oOnQueueUsers", "oInteracting" etc. ie: number of agents logged in, interacting etc. We were able to plug this into the Architect and check the number of agents on queue. More details here https://developer.mypurecloud.com/api/rest/v2/analytics/.

    Regards,
    Kevin

    ------------------------------
    Kevin Qi
    CVT (Global) Pty Ltd
    ------------------------------

    ------------------------------
    Kevin Qi
    CVT (Global) Pty Ltd
    ------------------------------



  • 6.  RE: In-Queue Agent Count

    Posted 05-22-2019 16:33
    Could you explain to me how did you create the custom data action using that API.

    Appreciate your help @Kevin Qi
    ​​

    ------------------------------
    Charaf Eddine Chemlal
    Dimension Data France
    ------------------------------



  • 7.  RE: In-Queue Agent Count

    Posted 05-22-2019 18:50
    Hello @Charaf Eddine Chemlal,

    We created a custom PC data action and use it in the call call flow, an example below:

    {
    "requestUrlTemplate": "/api/v2/analytics/queues/observations/query",
    "requestType": "POST",
    "headers": {
    "UserAgent": "PureCloudIntegrations/1.0",
    "content-type": "application/json"
    },
    "requestTemplate": "{\n \"filter\": {\n \"type\": \"or\",\n \"clauses\": [\n {\n \"type\": \"or\",\n \"predicates\": [\n {\n \"type\": \"dimension\",\n \"dimension\": \"queueId\",\n \"operator\": \"matches\",\n \"value\": \"xxxxxxx5f8-e715-45f1-91d7-11xxxxxxxxx\"\n }\n ]\n }\n ]\n },\n \"metrics\": [\n \"oOnQueueUsers\"\n ]\n}"
    }​


    {
    "translationMap": {
    "oOnQueueUsers": "$.results[0].data[0].stats.count"
    },
    "translationMapDefaults": {},
    "successTemplate": "{\"oOnQueueUsers\":${oOnQueueUsers}}"
    }

    Hope this helps.

    Regards,
    Kevin

    ------------------------------
    Kevin Qi
    CVT (Global) Pty Ltd
    ------------------------------



  • 8.  RE: In-Queue Agent Count

    Posted 07-29-2020 12:59
    Edited by Pooja Kumari 07-29-2020 13:10
    Hi Kevin,


    Can i get response and request contract for  "/api/v2/analytics/queues/observations/query",
    I tried this i am getting error


    ------------------------------
    Pooja Kumari
    ------------------------------



  • 9.  RE: In-Queue Agent Count

    Posted 01-31-2022 11:20
    Hello. I'm not sure if you we able to find a solution for this or not, but I was able to get my Action working with the details in this helpful post by @Craig Stevenson... RE: Inbound IVR - No agents on queue (JSON)

    It has a .txt file attachment that contains all of the JSON pieces needed to configure the components in the Action. ​​

    ------------------------------
    Patrick Rohlf
    Summit Broadband
    ------------------------------



  • 10.  RE: In-Queue Agent Count

    Posted 02-13-2022 13:50
    Hi Patrick,

    Did you manage to edit the Response when there is no agent On Queue,
    I'm getting an error. Any ideas?

    {
    "translationMap": {
    "on_queue_agents": "$.results[0].data[?(@.qualifier == 'IDLE')].stats.count"
    },
    "translationMapDefaults": {},
    "successTemplate": "{\"on_queue_agents\": \"${successTemplateUtils.firstFromArray(\"${on_queue_agents}\")}\" }"
    }

    Thanks,
    Omri


    ------------------------------
    OMRI ZVIELI
    TSG IT Advanced Systems Ltd
    ------------------------------



  • 11.  RE: In-Queue Agent Count

    Posted 02-13-2022 14:15
    HI Omri

    Try this for your successTemplate line:

    "successTemplate": "{\"on_queue_agents\": \"${successTemplateUtils.firstFromArray(\"${on_queue_agents}\",\"0\")}\" }"

    ------------------------------
    Vaun McCarthy
    ------------------------------



  • 12.  RE: In-Queue Agent Count

    Posted 02-13-2022 14:23
    Hi Vaun,

    Still getting an error:

    Failed while processing the translation map. Could not resolve value for the key: 'on_queue_agents' and no default value was configured. Additional details: Missing property in path $['results'][0]['data']

      JSON

      {
        "message": "Failed while processing the translation map. Could not resolve value for the key: 'on_queue_agents' and no default value was configured. Additional details: Missing property in path $['results'][0]['data']",
        "code": "bad.request",
        "status": 400,
        "messageParams": {},
        "contextId": "6e37b90e-8697-42b0-bc53-3dd8ed63b385",
        "details": [
          {
            "errorCode": "ACTION.PROCESSING"
          }
        ],
        "errors": []
      }
      Thanks!
      Omri

      ------------------------------
      OMRI ZVIELI
      TSG IT Advanced Systems Ltd
      ------------------------------



    • 13.  RE: In-Queue Agent Count

      Posted 02-13-2022 17:59
      Edited by OMRI ZVIELI 02-13-2022 18:07
      So I changed the Request Body Template from "oOnQueueUsers" to "oUserRoutingStatuses" and it's working fine,
      {"filter": {"type": "and","predicates": [{"dimension": "queueId", "value": "${input.QUEUE_ID}"}] },"metrics": ["oOnQueueUsers"]}

      Now I get the count of Idle On Queue agents.

      The only error I noticed is If there is no member configure on the Queue.

      ------------------------------
      OMRI ZVIELI
      TSG IT Advanced Systems Ltd
      ------------------------------



    • 14.  RE: In-Queue Agent Count

      Posted 02-14-2022 10:23
      Edited by Patrick Rohlf 02-14-2022 11:24

      Omri,

      I chose to build the solution this way, because I can use it to determine if there are any On Queue Users at all, while also getting additional information that I might wish to use for other decisions in the future.

      If I'm reading your original intent correctly, the sample that I shared should be able to give you everything that you need already. Meaning: If there are '0' agents in the Idle status AND '0' agents in the Interacting status, then you can assume that there are '0' On Queue Users. The sample that I shared with you, exactly as it was shared, should generate no error when there '0' users on queue. At least that's been my experience with it.    ;)

      I hope that helps. Good luck!

      {
        "name": "(PROD) POST-OnQueueUsers-RoutingStatus [2022-02-08] - Exported 2022-02-13 @ 16:49",
        "integrationType": "purecloud-data-actions",
        "actionType": "custom",
        "config": {
          "request": {
            "requestUrlTemplate": "/api/v2/analytics/queues/observations/query",
            "requestType": "POST",
            "headers": {
              "Content-Type": "application/json"
            },
            "requestTemplate": "{\n \"filter\": {\n \"type\": \"and\",\n \"predicates\": [\n {\n \"type\": \"dimension\",\n \"dimension\": \"queueId\",\n \"operator\": \"matches\",\n \"value\": \"${input.QUEUE_ID}\"\n }\n ]\n },\n \"metrics\": [\n \"oOnQueueUsers\"\n ]\n}"
          },
          "response": {
            "translationMap": {
              "Users_IDLE_Array": "$.results[0].data[?(@.qualifier == 'IDLE')].stats.count",
              "Users_INTERACTING_Array": "$.results[0].data[?(@.qualifier == 'INTERACTING')].stats.count"
            },
            "translationMapDefaults": {
              "Users_IDLE_Array": "[]",
              "Users_INTERACTING_Array": "[]"
            },
            "successTemplate": "{\"Users_IDLE\": ${successTemplateUtils.firstFromArray(\"${Users_IDLE_Array}\",\"0\")},\"Users_INTERACTING\": ${successTemplateUtils.firstFromArray(\"${Users_INTERACTING_Array}\",\"0\")}}"
          }
        },
        "contract": {
          "input": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "QUEUE_ID": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          },
          "output": {
            "successSchema": {
              "title": "oOnQueueUsers",
              "type": "object",
              "properties": {
                "Users_IDLE": {
                  "type": "integer"
                },
                "Users_INTERACTING": {
                  "type": "integer"
                }
              },
              "additionalProperties": true
            }
          }
        },
        "secure": false
      }​


      ------------------------------
      Patrick Rohlf
      Summit Broadband
      ------------------------------



    • 15.  RE: In-Queue Agent Count

      Posted 02-15-2022 14:54
      Edited by OMRI ZVIELI 02-15-2022 14:55
      Hi Patrick,

      Thanks for that!

      Actually what I want to achieve is to get only the Queue members that are currently logged in (no matter what is there status) for a Flow decision,
      I changed the Body Template to use oUserPresences and the translationMap to filter != 'OFFLINE' users.
      Any idea how to filter the output to get it in a total field? or maybe there is another way to do it in Architect? (without data action)


      {"filter": {"type": "and","predicates": [{"dimension": "queueId", "value": "${input.QUEUE_ID}"}] },"metrics": ["oUserPresences"]}
      


      {
      "translationMap": {
      "on_queue_agents": "$.results[0].data[?(@.qualifier != 'OFFLINE')].stats.count"
      },
      "translationMapDefaults": {},
      "successTemplate": "{\"on_queue_agents\": \"${successTemplateUtils.firstFromArray(\"${on_queue_agents}\",\"0\")}\" }"
      }


      Thanks,
      Omri


      ------------------------------
      OMRI ZVIELI
      TSG IT Advanced Systems Ltd
      ------------------------------



    • 16.  RE: In-Queue Agent Count

      Posted 02-15-2022 17:07
      Omri,

      So, you're saying that your end-goal is to: "Get a list of users, independent of status, that are logged into a specific queue. at a specific moment in time". Is that an accurate breakdown of what you are trying to achieve?

      ------------------------------
      Patrick Rohlf
      Summit Broadband
      ------------------------------



    • 17.  RE: In-Queue Agent Count

      Posted 02-16-2022 02:11
      Hi Patrick,

      Correct, I want to get the total number of all users that are currently logged in to the system and Assigned to a specific Queue.
      The business goal for the customer is to check if there are any agents that are relevant to get the call before transfer it to the queue,
      if no, then transfer it to a fallback queue with possibly much more agents.

      Best,
      Omri


      ------------------------------
      OMRI ZVIELI
      TSG IT Advanced Systems Ltd
      ------------------------------



    • 18.  RE: In-Queue Agent Count

      GENESYS
      Posted 02-17-2022 19:57
      Hey @OMRI ZVIELI and @Patrick Rohlf, Sam did a great demo of this topic in our latest episode of the Q&A Show. Check out the segment at the 12-minute mark.



      ------------------------------
      Matt Lawson
      Genesys - Employees
      Online Community Manager
      ------------------------------



    • 19.  RE: In-Queue Agent Count

      Posted 02-18-2022 13:38
      Hi Matt,
      That's awesome! Thx guys,
      I will sure give it a try next week.
      Great weekend,
      Omri


      ------------------------------
      OMRI ZVIELI
      TSG IT Advanced Systems Ltd
      ------------------------------



    • 20.  RE: In-Queue Agent Count

      Posted 04-28-2022 05:12
      This threat really helped me to get this topic done for my flow. Thanks alot!

      ------------------------------
      Thomas Repking
      Canada Life Group Services Limited
      ------------------------------



    • 21.  RE: In-Queue Agent Count

      GENESYS
      Posted 04-28-2022 07:46
      Excellent! Love hearing that. Thanks, @Thomas Repking!​

      ------------------------------
      Matt Lawson
      Genesys - Employees
      Online Community Manager
      ------------------------------



    • 22.  RE: In-Queue Agent Count

      Posted 11-08-2023 09:12

      Hi together,

      I've made some test and get struggling about the result....

      I want to archieve to evaluate the amount of agents that are at state "on queue" for a dedicated queue (regardless if they are busy with an interaction or  idle).

      Test 1)
      Every one is logged out of Genesys Cloud.

      Result:
      { "results": [ { "group": { "queueId": "8e9a2fb2-xxxx-xxxx-xxxx-aef40ce7f820" } } ] }

      -> That's OK

      Test 2)
      I am assigned to a queue and I am the only one.
      I am logged in but not "on queue".
      Result:
      { "results": [ { "group": { "queueId": "8e9a2fb2-xxxx-xxxx-xxxx-aef40ce7f820" }, "data": [ { "metric": "oOnQueueUsers", "qualifier": "INTERACTING", "stats": { "count": 1 } } ] } ] }
      -> Why do I get a count of "1" interacting user?

      Test 3)
      I am assigned to a queue and I am the only one.
      I am logged in and I am "on queue".
      Result:
      { "results": [ { "group": { "queueId": "8e9a2fb2-xxxx-xxxx-xxxx-aef40ce7f820" }, "data": [ { "metric": "oOnQueueUsers", "qualifier": "INTERACTING", "stats": { "count": 1 } }, { "metric": "oOnQueueUsers", "qualifier": "IDLE", "stats": { "count": 1 } } ] } ] }
      -> Now I have one interacting user and one idle user. The idle user is correct, but not the interacting one.

      Test 4)
      I am assigned to a queue and I am the only one.
      I am logged in, I am "on queue" and I am in a active ACD call.
      Result:
      { "results": [ { "group": { "queueId": "8e9a2fb2-xxxx-xxxx-xxxx-aef40ce7f820" }, "data": [ { "metric": "oOnQueueUsers", "qualifier": "INTERACTING", "stats": { "count": 2 } } ] } ] }

      -> Now I have two (!) interacting user.

      Do I have a wrong understanding of:

      •  an assigned user: assigned to a queue
      • an "on queue" user: user is ready to receive ACD interactions
      • an "interacting" user: user is at an ongoing interaction

      ???

      THANKS for clarification.

      BR, Robert



      ------------------------------
      Robert Herms
      Arvato Systems GmbH
      ------------------------------



    Need Help finding something?

    Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources