Legacy Dev Forum Posts

 View Only

Sign Up

Conversations Detail Query API - Get conversations within the given range

  • 1.  Conversations Detail Query API - Get conversations within the given range

    Posted 06-05-2025 19:07

    namannassa1997 | 2022-08-04 13:47:06 UTC | #1

    Hi,

    I am trying to get the conversations within the given range.

    I am using this API - https://api.{{environment}}/api/v2/analytics/conversations/details/query

    I was using this in the request body - { "interval": "2022-07-19T06:30:00Z/2022-07-19T06:35:00Z", "paging": { "pageSize": 100, "pageNumber": 1 }, "segmentFilters": [ { "type": "and", "predicates": [ { "dimension": "mediaType", "value": "email" } ] } ] }

    This gives me the correct results for conversations that start between the given interval.

    When I use this in request body - {

    "interval": "2022-07-19T06:35:00Z/2022-07-19T06:40:00Z",

    "paging": {

    "pageSize": 100,

    "pageNumber": 1

    },

    "segmentFilters": [

    {

    "type": "and",

    "predicates": [

    {

    "dimension": "mediaType",

    "value": "email"

    }

    ]

    }

    ]

    }

    It still returns the conversations that start at "2022-07-19T06:32:08.897Z" or "2022-07-19T06:32:40.779Z".

    I want only those conversations that start within the given interval not outside the interval.

    I also tried using this in request body but it gives me an error - {

    "interval": "2022-07-19T06:25:00Z/2022-07-19T06:30:00Z",

    "paging": {

    "pageSize": 100,

    "pageNumber": 1

    },

    "conversationFilters": [

    {

    "type": "and",

    "predicates": [

    {

    "dimension": "conversationStart",

    "range": {

    "gt": "2022-07-19T06:25:00Z"

    }

    }

    ]

    }

    ],

    "segmentFilters": [

    {

    "type": "and",

    "predicates": [

    {

    "dimension": "mediaType",

    "value": "email"

    }

    ]

    }

    ]

    }

    or this - {

    "interval": "2022-07-19T06:25:00Z/2022-07-19T06:30:00Z",

    "paging": {

    "pageSize": 100,

    "pageNumber": 1

    },

    "conversationFilters": [

    {

    "type": "and",

    "predicates": [

    {

    "propertyType": "DateTime",

    "property": "conversationStart",

    "range": {

    "gt": "2022-07-19T06:25:00Z"

    }

    }

    ]

    }

    ],

    "segmentFilters": [

    {

    "type": "and",

    "predicates": [

    {

    "dimension": "mediaType",

    "value": "email"

    }

    ]

    }

    ]

    }

    Error - {

    "message": "Value [2022-07-19T06:25:00Z] is not a valid property for object [BigDecimal]",

    "code": "invalid.property",

    "status": 400,

    "contextId": "a25b04ea-e6e1-4fae-b875-7fc51bfcd3ca",

    "details": [],

    "errors": []

    }

    I only want those conversations that start in the given interval. Is this possible ?


    Jerome.Saint-Marc | 2022-08-04 14:08:21 UTC | #2

    Hello,

    There is an explanation on interval for detailed queries on the Dev Center: https://developer.genesys.cloud/analyticsdatamanagement/analytics/detail/#interval "The interval will filter based on the conversation start timestamp. Conversations will only be included in the results if their start occurs on a day that the interval touches. The actual time of the conversation start need not be within the interval as long as it occurs on a day involved in the interval."

    What you can do is to create a filter with a range for the conversationStart dimension - it seems to work for datetime attributes. See example below:

    { "interval": "2022-07-19T06:30:00Z/2022-07-19T06:35:00Z", "order": "asc", "orderBy": "conversationStart", "paging": { "pageSize": "100", "pageNumber": "1" }, "segmentFilters": [ { "type": "and", "predicates": [ { "type": "dimension", "dimension": "mediaType", "operator": "matches", "value": "email" } ] } ], "conversationFilters": [ { "type": "and", "predicates": [ { "type": "dimension", "dimension": "conversationEnd", "operator": "matches", "value": "2022-07-19T06:30:00Z/2022-07-19T06:35:00Z" } ] } ] }

    Regards,


    system | 2022-09-04 14:08:23 UTC | #3

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


    This post was migrated from the old Developer Forum.

    ref: 15789