Query queues by requestedRoutingSkillId

We are trying to get the number of idle agents on a queue assigned with specific skill using Analytics > Queue observation API. However, the query returns 400 error with msg "Unable to decompose query into a set of (queueId, mediaType) pairs". Adding a mediatype filter doesnt help.

The definition of the API endpoint includes requestedRoutingSkillID as a parameter and its mentioned to be a valid dimension here https://developer.mypurecloud.com/api/rest/v2/analytics/dimensions.html

Can anyone help in this regards?

The query we are trying is :

{
"filter": {
"type": "and",
"clauses": [
{
"type": "or",
"predicates": [
{
"dimension": "queueId",
"value": "9336e674-738f-447d-8600-9ca9c16d3269"
}
]
},
{
"type": "or",
"predicates": [
{
"dimension": "mediaType",
"value": "voice"
}
]
},
{
"type": "or",
"predicates": [
{
"dimension": "requestedRoutingSkillId",
"value": "856fb15d-ea9b-4e32-860d-4fb5688b00a5"
}
]
}
]
}
}

Error:

{
"status": 400,
"code": "bad.request",
"message": "Unable to decompose query into a set of (queueId, mediaType) pairs.",
"messageParams": {},
"contextId": "262e48fc-c4e5-4135-ac7d-3771be6e5304",
"details": [],
"errors": []
}

You need a group by clause in the query. You either need one of those two fields, or possibly both.

@tim.smith Thank you. We did try combinations, but nothing seems to work. Actually, the following query is the one which we want to enhance and add requestedRoutingSkillId in addition to the queue Id input.

The query as it is gives us the result we needed ( onQueueUsers ) for a given queue id, but when we try to combine skill ( so we can get onQueueUsers for a queue per skill ), we get the error mentioned ' Unable to decompose...'

{
 "filter": {
  "type": "and",
  "clauses": [
   {
    "type": "or",
    "predicates": [
     {
      "type": "dimension",
      "dimension": "queueId",
      "operator": "matches",
      "value": "2df63990-1e6a-4b52-b43f-5567a7cd0d78"
     }
    ]
   }
  ]
 },
 "metrics": [
  "oOnQueueUsers"
 ]
}

Sorry, my previous answer was incorrect. Queue observation queries don't support a group by clause (was thinking of the aggregate query, where you'll get this error when your group by clause is lacking). This might not be a bug and queue observations just don't support filtering, but there isn't any documentation for queue observation queries that would indicate that limitation. Please open a case with PureCloud Care to investigate this error.

@tim.smith Thank you for your input. Have raised case #0002377865 for the same.

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