Legacy Dev Forum Posts

 View Only

Sign Up

Retrieving conversation data by ani

  • 1.  Retrieving conversation data by ani

    Posted 06-05-2025 18:28

    nick.wright | 2023-10-27 10:33:17 UTC | #1

    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=<telephone number> 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<ani>" } ] } ] }

    replacing the <ani> 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!


    Eos_Rios | 2023-10-27 12:40:14 UTC | #2

    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.


    nick.wright | 2023-10-27 13:01:10 UTC | #3

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


    Alastair_Pitt | 2023-11-21 11:27:38 UTC | #4

    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


    nick.wright | 2023-11-21 11:57:28 UTC | #5

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


    Alastair_Pitt | 2023-11-21 13:11:27 UTC | #6

    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" } ] } ] }


    system | 2023-12-21 13:12:08 UTC | #7

    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: 22779