Retrieving conversation data by ani

I need to retrieve all calls from a given number for the past two weeks, where the participant data is a particular value. When I call the GET /api/v2/conversations/{conversationId} it returns a valid record and the data I need is in the attributes:

..."attributes": {
...
"Log.Menu Option": "Service",
...
}

So, I need to run a query where ani= and attributes.Log.Menu Option= "Service". I'm using the POST /api/v2/analytics/conversations/details/query with the following request body:

{
"interval": "2023-10-01T00:00:00.000Z/2023-10-31T00:00:00.000Z",
"segmentFilters": [
{
"type": "or",
"predicates": [
{
"propertyType": "string",
"property": "ani",
"value": "tel:+44"
}
]
}
]
}

replacing the with the actual number. The call was made on 24 October.

I've also tried

{
"interval": "2023-10-01T00:00:00.000Z/2023-10-31T00:00:00.000Z",
"segmentFilters": [
{
"type": "or",
"predicates": [
{
"propertyType": "uuid",
"property": "conversationId",
"value": "d7da3dda-eb31-466c-965c-981f69088aaa"
}
]
}
]
}

just to test it, but neither returns any data. Pretty sure I'm getting the syntax wrong, but the documentation is really sketchy around these queries. So, my questions are:

  1. Can I achieve what I want with the Conversations Details Query? I'm willing to accept a solution where I get an array of conversationIDs returned from a query that matches the ani, and then call GET /api/v2/conversations/{conversationId} to get the log.Menu Option.

  2. Is there any detailed documentation on the Conversation Details Query, other than this https://developer.genesys.cloud/analyticsdatamanagement/analytics/detail/conversation-query which doesn't go into enough detail?

  3. Is the syntax of the queries above correct?

Many thanks!

I would recommend using the API Explorer to better understand what you can do and what that looks like.

ConversationId for example should be a dimension, not a property.
Also probably worth noting the ConversationId doesn't exist in the segment, it's in the root of the tree.

Thanks, this older API Explorer seems to be easier to use

Hi @nick.wright I agree, the old API Explorer was easier to get around. Did you find a solution to this? I am looking to do something similar and wondered what you did. Thanks

I'm still trying to figure out what I'm going to do, might need a completely different approach

Thanks @nick.wright
I just need to pull the number of calls by a caller during a period of time, so I used the below, and that worked, but this is different from your requirement, but your query helped me, thanks

{
"interval": "2023-11-01T05:00:00.000Z/2023-11-20T05:00:00.000Z",
"order": "asc",
"orderBy": "conversationStart",
"paging": {
"pageSize": 100,
"pageNumber": 1
},
"segmentFilters": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "mediaType",
"operator": "matches",
"value": "voice"
},
{
"type": "dimension",
"dimension": "ani",
"operator": "matches",
"value": "tel:+123456789"
}
]
}
]
}

1 Like

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