Hello,
Method 1
If you know the ANI/CLI of a caller (their phone number) and you want to know how many times he called in last 24 hours (or in a given interval), you can use an Analytics Query for Conversation Details.
This is what I described in this post: https://developer.mypurecloud.com/forum/t/number-of-interations-per-ani/10028
Method 2
I just thought about another way, this time using Analytics Query for Conversation Aggregates, and requesting nOffered or nConnected metrics.
If you know the telephone number, you could have the following request body:
{
"interval": "2021-02-28T23:00:00.000Z/2021-03-04T23:00:00.000Z",
"groupBy": [
"ani"
],
"filter": {
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "mediaType",
"operator": "matches",
"value": "voice"
},
{
"type": "dimension",
"dimension": "ani",
"operator": "matches",
"value": "tel:+ 33123456789"
}
]
},
"views": [],
"metrics": [
"nConnected",
"nOffered"
]
}
You can also use this same Analytics Query for Conversation Aggregates to retrieve the number of times each ANI/CLI called in the interval. But you would also get people who have called one time only. So you would need to parse the response and check data/people who have a nOffered or nConnected metric greater than 2, 3 4, ...
The aggregate query will group data by ani.
{
"interval": "2021-02-28T23:00:00.000Z/2021-03-04T23:00:00.000Z",
"groupBy": [
"ani"
],
"filter": {
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "mediaType",
"operator": "matches",
"value": "voice"
}
]
},
"views": [],
"metrics": [
"nConnected",
"nOffered"
]
}
Regards,