Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Queue Observations - oActiveUsers

    Posted 07-29-2025 03:32

    Hello,

    Definition oActiveUsers = Observed number of active users in a queue.
    --> I suppose the active users here are the users logged in and linked to the queue. 
    --> I presume that Active doesn't mean people who are not deleted or inactivated in the "people" admin page.
    Source = https://developer.genesys.cloud/analyticsdatamanagement/analytics/metrics#routing-observation-metrics


    I'm getting a number back which equals the total number of users linked to the queue (also those who are offline) when using
    API /api/v2/analytics/queues/observations/query in "API developer center".
    {
      "metrics": [
        "oActiveUsers"
      ],
      "filter": {
        "type": "and",
        "clauses": [
          {
            "type": "or",
            "predicates": [
              {
                "dimension": "queueId",
                "value": "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
              }
            ]
          }
        ]
      }
    }

    --> Results
    { "results": [ { "group": { "queueId": "XXXXXXXXXXXXXXXXXXXXXXXXXXX" }, "data": [ { "metric": "oActiveUsers", "stats": { "count": 3 } } ] } ] }

    I can see in the queue activity detail screen 3 users. 1 is in Available state and 2 are offline.

    Is my query wrong or am I interpreting the definition wrongly? (I need this to verify if a call can remain in queue or not within architect.. it doesn't make sense to allow calls in queue when no one is even logged in into the queue.

    Thanks for the help
    Stijn Serry
    Smals


    #PlatformAPI

    ------------------------------
    Stijn Serry
    Technical Coordinator CRM
    ------------------------------


  • 2.  RE: Queue Observations - oActiveUsers

    Posted 07-29-2025 06:34

    Ok, it was apparently misinterpretation.

    oActiveUsers is the number of agents which are member of the queue and have the queue really active for them (functionality exist in Genesys to be member but deactivate the queue) via user preferences.

    I need to realize my query via another means then. 

    It would have been great to have an oLoggedInUsers counter in observations to avoid a lot of extra manipulations within the data action or architect.

    Stijn



    ------------------------------
    Stijn Serry
    Technical Coordinator CRM
    ------------------------------



  • 3.  RE: Queue Observations - oActiveUsers

    Posted 07-30-2025 01:49

    Hi Stijn,

    I wasn't aware of that metric. Thank you very much - this will help me with some problems.



    ------------------------------
    Christoph Domaschke
    Leiter Service Center (Cronbank)
    ------------------------------



  • 4.  RE: Queue Observations - oActiveUsers

    Posted 07-31-2025 06:10
    Edited by Brian Jones 07-31-2025 06:15

    Greetings @Stijn Serry - We agree a simple "oLoggedInUsers" dimension would be ideal. If passionate enough about the idea, you can create an enhancement request here. In the meantime, in case you haven't figured out a workaround...

    We ended up calculating the "No Agents Logged In" value in our flow using the same API you're using above (grabbed the Offline user presence count) coupled with the Queue Members API. After running both data actions in Architect, we did a count of the Queue Members and then subtracted the count of Offline Users to get our total users logged in.



    ------------------------------
    Brian T. Jones | Ascension | Senior Specialist - Technology
    ------------------------------



  • 5.  RE: Queue Observations - oActiveUsers
    Best Answer

    Posted 07-31-2025 06:28
      |   view attached

    Hello,

    Yes, I'm using the same solution as you. Great that this solution is confirmed then. 
    For others: I uploaded the data action json file as txt file (uses integration: "Genesys Cloud Contact Data Actions" ) and do the calculation within architect in-queue flow to have the active members - logged out users to verify if there or users logged in into the system which take part of the queue.
    You cannot make the calculation within the data action as Genesys doesn't support this in the translationmap.



    ------------------------------
    Stijn Serry
    Technical Coordinator CRM
    ------------------------------



  • 6.  RE: Queue Observations - oActiveUsers

    Posted 08-04-2025 13:18

    So while I agree that you can't do math in the translation map, you might be able to do it in the response template.  What exactly is the math that you are doing?



    ------------------------------
    --Jason
    ------------------------------



  • 7.  RE: Queue Observations - oActiveUsers

    Posted 08-05-2025 01:27

    Hello Jason,

    I need to get the total of Logged In Users. I'm getting this back from the REST call and returning both active members and  logged out users towards architect where i can deduct active members - logged out users to find out the number of logged in users.

    Stijn



    ------------------------------
    Stijn Serry
    Technical Coordinator CRM
    ------------------------------



  • 8.  RE: Queue Observations - oActiveUsers

    Posted 08-06-2025 12:49

    Are you getting everything you need from a single API response?  If so, can you give me an example of it with anything sensitive redacted?



    ------------------------------
    --Jason
    ------------------------------



  • 9.  RE: Queue Observations - oActiveUsers

    Posted 08-27-2025 12:17

    I configured an endpoint that returns this response:

    {
      "foo": 10,
      "bar": 7
    }

    And then setup a working response like this:

    {
      "translationMap": {
        "foo": "foo",
        "bar": "bar"
      },
      "translationMapDefaults": {},
      "successTemplate": "#set( $Integer = 0 ) #if (!$foo) #set ($foo = \"0\") #end #if (!$bar) #set ($bar = \"0\") #end #set( $total = $!Integer.parseInt($foo) + $!Integer.parseInt($bar)) {\"total\" : $total}"
    }

    The $Integer variable is a hack to get an instance of an Integer object.

    I had to add the code like this to set default values due to some sort of validation weirdness. I opened an internal ticket for us to investigate.

    #if (!$foo) #set ($foo = \"0\") #end #if (!$bar) #set ($bar = \"0\") #end
    After that it does math on the two variables and returns it.


    ------------------------------
    --Jason
    ------------------------------