Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Count the number of calls waiting in multiple queues

    Posted 03-11-2025 21:34
    No replies, thread closed.
    Hello Everyone.
     
    I want to count the number of waiting calls for a given multiple queue using POST /api/v2/analytics/queues/observations/query.
     
    I have Execute Requested the following request template in API Explorer and got Response: 200.
     
    However, when I tested the same configuration on the actual data action screen, the following error occurred
    What is the cause of the failure in the Genesys Cloud data action, even though it was successfully executed in the API Explorer?
     
    <Error Message>
    Execute: The request could not be understood by the server due to malformed syntax.
     
    REST call for action execute failed. Message: Request to backend service failed. Unable to decompose query into a set of (queueId, mediaType) pairs.", 'code': 'bad.request', 'status':400, 'messageParams':{}, 'contextId': "5b351d75-3ba2-47f2-8f83-1f7b 48651686", 'details':[], 'errors':[]} [b05cfc63-db1e-4707-9dd8-a2da7ce6a87e]
     
    <Request Body Templete>
    {
      "filter": {
        "type": "and",
        "clauses": [
          {
            "type": "or",
            "predicates": [
              {
                "type": "dimension",
                "dimension": "queueId",
                "operator": "matches",
                "value": "99999999-9999-9999-9999-999999999999"
              },
              {
                "type": "dimension",
                "dimension": "queueId",
                "operator": "matches",
                "value": "99999999-9999-9999-9999-999999999999"
              },
              {
                "type": "dimension",
                "dimension": "queueId",
                "operator": "matches",
                "value": "99999999-9999-9999-9999-999999999999"
              }
            ]
          }
        ],
        "predicates": [
          {
            "type": "dimension",
            "dimension": "mediaType",
            "operator": "matches",
            "value": "voice"
          }
        ]
      },
      "metrics": [
        "oWaiting"
      ]
    }

    #API/Integrations

    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------


  • 2.  RE: Count the number of calls waiting in multiple queues

    Posted 03-12-2025 02:11
    No replies, thread closed.

    Hi Matsumoto,

    The queue IDs provided are unique. I'm assuming that you've already tried using the actual Queue IDs and it didn't work, which is why you're using dummy values here?

    Regards

    Phaneendra



    ------------------------------
    Phaneendra Avatapalli
    Client Support, Desktop Support
    ------------------------------



  • 3.  RE: Count the number of calls waiting in multiple queues

    Posted 03-12-2025 06:07
    No replies, thread closed.

    Hello Matsumoto,

    I just copied your query and tested against my test org, the only change I made was to replace the queue IDs with my queues and it did indeed show the two waiting calls I had.

    "results": [
        {
          "group": {
            "queueId": "28e96a73-2776-43c1-82d2-03fd956cd652",
            "mediaType": "voice"
          },
          "data": [
            {
              "metric": "oWaiting",
              "stats": {
                "count": 1
              }
            }
          ]
        },
        {
          "group": {
            "queueId": "01b21902-c378-45ec-8df1-aef30d6638d2",
            "mediaType": "voice"
          },
          "data": [
            {
              "metric": "oWaiting",
              "stats": {
                "count": 1

    So, other than not having valid queueIDs in your example, your query does work.



    ------------------------------
    Sam Jillard
    Online Community Manager/Moderator
    Genesys - Employees
    ------------------------------



  • 4.  RE: Count the number of calls waiting in multiple queues
    Best Answer

    Posted 03-12-2025 19:13
    No replies, thread closed.

    The request worked in the API Explorer because it might have allowed mock or redundant data. However, in Genesys Cloud Data Action, strict validation is enforced, requiring unique and valid queueId values for the request to process successfully, which could be why it showed the right results."



    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    Monash University
    Australia
    ------------------------------



  • 5.  RE: Count the number of calls waiting in multiple queues

    Posted 03-13-2025 04:05
    No replies, thread closed.

    I made some changes to the query, registered the queue IDs that exist in the organization on the input screen, and tested the results, which showed the same error as above.


    {
      "filter": {
        "type": "and",
        "clauses": [
          {
            "type": "or",
            "predicates": [
              {
                "type": "dimension",
                "dimension": "queueId",
                "operator": "matches",
                "value": "${input.queueId1}"
              },
              {
                "type": "dimension",
                "dimension": "queueId",
                "operator": "matches",
                "value": "${input.queueId2}"
              },
              {
                "type": "dimension",
                "dimension": "queueId",
                "operator": "matches",
                "value": "${input.queueId3}"
              }
            ]
          }
        ],
        "predicates": [
          {
            "type": "dimension",
            "dimension": "mediaType",
            "operator": "matches",
            "value": "voice"
          }
        ]
      },
      "metrics": [
        "oWaiting"
      ]
    }

    I executed the same query in a different organization than the one where the error occurred this time, and the response was returned without any problems.

    Best Regards,



    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------



  • 6.  RE: Count the number of calls waiting in multiple queues

    Posted 03-13-2025 04:22
    Edited by Phaneendra Avatapalli 03-13-2025 04:26
    No replies, thread closed.

    Hi Matsumoto, Please try the inputs as the below body template

    {
      "queueIds": ${input.QUEUE_IDS_LIST}
    }

    Assume that Queue ID's contains

    ["queueId-1", "queueId-2", "queueId-3"]

    The result request body will look like this:

    {
      "queueIds": ["queueId-1", "queueId-2", "queueId-3"]
    }




    Or you can try using real queue id's in the body template itself should work.



    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    Monash University
    Australia
    ------------------------------