Marinica_Stefan-Alex | 2024-10-08 09:59:04 UTC | #1
Hello,
I'm trying to filter the Analytics API /api/v2/analytics/conversations/activity/query by multiple skill ids. I tried with multiple predicates but I receive error "Attempting to set multiple values for dimension: requestedRoutingSkillId", or by using one predicates with multiple skill ids which returns another error "invalid dimension value".
{ "filter": { "type": "or", "clauses": [ { "type": "and", "predicates": [ { "type": "dimension", "dimension": "queueId", "operator": "matches", "value": "0ad14cf6-ca6c-4bc3-ad6c-26f7e21dxxxx" }, { "type": "dimension", "dimension": "requestedRoutingSkillId", "operator": "matches", "value": "dc200bac-0212-45e5-add9-a118d580yyyy" }, { "type": "dimension", "dimension": "requestedRoutingSkillId", "operator": "matches", "value": "309ae7d2-1420-464a-af28-bbd2f816zzzz" } ] } ] }, "order": "asc", "metrics": [ { "metric": "oWaiting", "details": true } ], "groupBy": [ "queueId" ] }
{ "filter": { "type": "or", "clauses": [ { "type": "and", "predicates": [ { "type": "dimension", "dimension": "queueId", "operator": "matches", "value": "0ad14cf6-ca6c-4bc3-ad6c-26f7e21dxxxx" }, { "type": "dimension", "dimension": "requestedRoutingSkillId", "operator": "matches", "value": "dc200bac-0212-45e5-add9-a118d580yyyy, 309ae7d2-1420-464a-af28-bbd2f816zzzz" } ] } ] }, "order": "asc", "metrics": [ { "metric": "oWaiting", "details": true } ], "groupBy": [ "queueId" ] }
Am I doing something wrong or this is a limitation and I need to extract the detailed result and process it in another place?
Thank you, Stefan
Jerome.Saint-Marc | 2024-10-08 10:52:30 UTC | #2
Hello,
You can use something like the following:
{
"filter": {
"type": "or",
"clauses": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "queueId",
"operator": "matches",
"value": "0ad14cf6-ca6c-4bc3-ad6c-26f7e21dxxxx"
},
{
"type": "dimension",
"dimension": "requestedRoutingSkillId",
"operator": "matches",
"value": "dc200bac-0212-45e5-add9-a118d580yyyy"
}
]
},
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "queueId",
"operator": "matches",
"value": "0ad14cf6-ca6c-4bc3-ad6c-26f7e21dxxxx"
},
{
"type": "dimension",
"dimension": "requestedRoutingSkillId",
"operator": "matches",
"value": "309ae7d2-1420-464a-af28-bbd2f816zzzz"
}
]
}
]
},
"order": "asc",
"metrics": [
{
"metric": "oWaiting",
"details": true
}
],
"groupBy": [
"queueId"
]
}
2 Clauses with an OR statement. Clause 1: Queue1 AND SkillA Clause 2: Queue1 AND SkillB
Regards,
Marinica_Stefan-Alex | 2024-10-08 13:28:56 UTC | #3
Hi,
Thanks for update. It's partially working. If I have a call for both intended skills and another call with just one of the two, will return both calls and I would like just the one that has both. If I change to the AND statement (which I think would solve my problem) I get again the error for multiple requestedRoutingSkillId
Regards, Stefan
Marinica_Stefan-Alex | 2024-10-09 14:54:18 UTC | #4
Hello,
I achieved to filter for multiple skills with adding another value in the same predicate:
{ "metrics": [ { "metric": "oWaiting", "details": true } ], "groupBy": [ "queueId" ], "filter": { "type": "and", "predicates": [ { "type": "dimension", "dimension": "queueId", "operator": "matches", "value": "0ad14cf6-ca6c-4bc3-ad6c-26f7e21daxxx" }, { "type": "dimension", "dimension": "requestedRoutingSkillId", "operator": "matches", "value": "dc200bac-0212-45e5-add9-a118d580cyyy", "value": "309ae7d2-1420-464a-af28-bbd2f816bzzz" } ] }, "order": "asc" }
I don't know if this a correct use of the resource or we can expect errors.
Best regards, Stefan
Jerome.Saint-Marc | 2024-10-10 12:51:07 UTC | #5
Hello,
Unfortunately, this will not work. The "value" is only taken once (I mean only the second entry/value in your filter is taken into account). Apparently, it is not possible to request multiple requestedRoutingSkillId at once with this endpoint.
Regards,
system | 2024-11-09 12:51:32 UTC | #6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 29757