Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Get the count of total in-queue call for all voice queues in architect flow.

    Posted 02-19-2024 15:01
    No replies, thread closed.

    Hello There,

    We have a requirement to send the caller to a different flow or disconnect if the total calls in all voice queues is greater than 10 (we have multiple voice queues). I tried to use "/api/v2/analytics/flows/observations/query" in architect as data action. But unable to use it as architect does not allow the use of nested arrays. Let me know if there are other ways to achieve it.

    Regards,

    Rizwan


    #ArchitectureandDesign
    #Implementation
    #PlatformAdministration
    #SystemAdministration

    ------------------------------
    Rizwan Khan
    Tata Consultancy Services Ltd
    ------------------------------


  • 2.  RE: Get the count of total in-queue call for all voice queues in architect flow.

    Posted 02-19-2024 16:08
    No replies, thread closed.

    For you to use nested arrays in Architect, test the recommendation below:

    • Create a string field in the output contract. Then in Architect use an Update Action to convert from string to JSON using JsonParse.

    Att,



    ------------------------------
    Breno Canyggia Ferreira Marreco
    https://www.linkedin.com/in/brenocfm-40b62182/
    ------------------------------



  • 3.  RE: Get the count of total in-queue call for all voice queues in architect flow.
    Best Answer

    Posted 02-19-2024 19:41
    No replies, thread closed.

    Generally I use /api/v2/analytics/conversations/aggregates/query to query a queue's metrics,

    Then in my DataAction in the success template use a JSON path to specify which metric I am after, and then use First From Array to convert the result from an array to a string, since I know there will only be one value. 

    Almost any Genesys queue or conversation API is going to be in the format of Object, array of objects, array of values 

    And you can absolutely still use DataActions in Genesys Architect to grab those values.

    Check out this discussion to get yourself started on using the first from array velocity macro

    https://developer.genesys.cloud/forum/t/how-should-i-structure-the-first-from-array-response-here/8683

    Or as Breno mentioned you could use it as a JSON object, but that can be more fiddly and very little error detection / handling in place for that.



    ------------------------------
    Anton Vroon
    ------------------------------



  • 4.  RE: Get the count of total in-queue call for all voice queues in architect flow.

    Posted 02-20-2024 04:43
    No replies, thread closed.

    Hello,

    If you just want to know how many are currently in queue you can use GET /api/v2/analytics/queues/observations/query

    Then use TranslationMap to filter out just the Count value so that will be returned in a collection.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------



  • 5.  RE: Get the count of total in-queue call for all voice queues in architect flow.

    Posted 02-20-2024 04:59
    No replies, thread closed.
    JSON response from API
    This is the response I am getting from that API. I need help to add all the values for "count" and use it as a variable in architect.


    ------------------------------
    Rizwan Khan
    Tata Consultancy Services Ltd
    ------------------------------



  • 6.  RE: Get the count of total in-queue call for all voice queues in architect flow.

    Posted 02-20-2024 09:10
    No replies, thread closed.

    Hi Rizwan Khan,

    You need to use a translation map for the filter field.

    https://help.mypurecloud.com/articles/response-configuration-data-actions/

    I like to use https://jsonpath.com/ to help create my jsonpath.

    Att,



    ------------------------------
    Breno Canyggia Ferreira Marreco
    https://www.linkedin.com/in/brenocfm-40b62182/
    ------------------------------



  • 7.  RE: Get the count of total in-queue call for all voice queues in architect flow.

    Posted 02-20-2024 13:55
    No replies, thread closed.

    If you are new to json paths, something like this

    $.results[*].data[*].stats.count

    will give you an array of the count values.

    In Architect once you have your array, you can loop through the results and add them altogether. There might be a way to do it with velocity macros but might be more complicated than just doing the addition in Architect.



    ------------------------------
    Anton VroonAnton Vroon
    ------------------------------



  • 8.  RE: Get the count of total in-queue call for all voice queues in architect flow.

    Posted 02-20-2024 15:22
    No replies, thread closed.

    Thank you all for your support, it is now working.



    ------------------------------
    Rizwan Khan
    Tata Consultancy Services Ltd
    ------------------------------