Make filter of agents with analytics API

Hi all ,
I'm using the API /api/v2/analytics/conversations/details/query for retrieve the last user who has answered to a specific phone number.
My requirement is to retrieve the last agentid who has answer to a call except for 2 agents (because there are beginers and I don't want they receive any other call).

-> I'm thiniking about list all the userid where I want retrive their userid (minus the 2 agent userid who are beginers ) like displayed in the code below

"type": "or",
"predicates": [
{
"type": "dimension",
"dimension": "userId",
"operator": "matches",
"value": "XXXXXXXXXXXXXXXXX"
},
{
"type": "dimension",
"dimension": "userId",
"operator": "matches",
"value": "YYYYYYYYYYYYYYY"

The problem
-> the list of userid is huge and must be updated.Is there another way to achieve my requirement?

-> I would like use the operation `notExists' operator instead matches, but with this operation I cannot configure a specifc userid.
thanks
jeremy

Below the complete code :

{
"interval": "2022-10-24T22:00:00.000Z/2022-10-26T22:00:00.000Z",
"order": "asc",
"orderBy": "conversationStart",
"paging": {
"pageSize": 25,
"pageNumber": 1
},
"segmentFilters": [
{
"type": "and",
"clauses": [
{
"type": "or",
"predicates": [
{
"type": "dimension",
"dimension": "userId",
"operator": "matches",
"value": "XXXXXXXXXXXXXXXXX"
},
{
"type": "dimension",
"dimension": "userId",
"operator": "matches",
"value": "YYYYYYYYYYYYYYY"
}
]
}
],
"predicates": [
{
"type": "dimension",
"dimension": "ani",
"operator": "matches",
"value": "+33XXXXXX"
}
]
}
]
}

This will be a VERY inefficient query. You should simply retrieve the conversations based on the other criteria (such as caller's ANI), sort by end date to put the most recent first, and work through the list in your application to find the first one with an agent that does/doesn't match your list.

That checks for null data. You cannot apply negative filters (i.e. doesn't match X).

Thanks Tim, I wanted to have confirmation about feasibility with analytics API and you have answered to my question

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