Legacy Dev Forum Posts

 View Only

Sign Up

Conversation analytics API not respecting the 'interval' parameter

  • 1.  Conversation analytics API not respecting the 'interval' parameter

    Posted 06-05-2025 18:12

    Matthew_Prast | 2017-09-27 23:51:15 UTC | #1

    Hi all, Lately we've been seeing the analytics api returning conversations that have 'conversationStart' set to a date outside of the requested interval. For example, when making a request to 'https://api.mypurecloud.com/api/v2/analytics/conversations/details/query' with the body

    '{"paging": {"pageNumber": 1, "pageSize": 100}, "interval": "2017-09-11T20:56:12/2017-09-18T20:56:12"}'

    we receive a JSON response such that

    max(map(lambda row: row['conversationStart'], json_resp['conversations']))

    is '2017-09-11T20:56:11.330Z', and

    min(map(lambda row: row['conversationStart'], json_resp['conversations']))

    is '2017-09-11T15:58:56.817Z' (both expressions above are written in python). It seems that all of these conversations happened before the start of the request interval. Any idea what could be going on? The description of the interval parameter on the conversation API says "Specifies the date and time range of data being queried. Conversations MUST have started within this time range to potentially be included within the result set", which leads me to believe that the query interval is based on the time in which the conversation started. Is this correct? Thanks for your help w\ this -

    -Matt


    tim.smith | 2017-10-02 16:01:36 UTC | #2

    Matthew_Prast, post:1, topic:1874
    The description of the interval parameter on the conversation API says "Specifies the date and time range of data being queried. Conversations MUST have started within this time range to potentially be included within the result set"

    That's not 100% correct. Results will include conversations where any part of the conversation existed within the specified interval. I've opened API-2894 to correct that documentation.


    Matthew_Prast | 2017-10-02 18:27:19 UTC | #3

    Hey Tim, Is there any way to get the API to return results based on start or end date? We can technically make things work as is but for bookkeeping\debugging purposes it would be really nice to just be able to cross-reference intervals against a bare conversation field. Thanks-

    -Matt


    tim.smith | 2017-10-02 19:03:33 UTC | #4

    No, range filters are only valid for metrics, so you can't constrain the results for a dimension to a range. You'll have to refine the results client-side. Sorting by conversation start or end may make that task a bit easier.


    system | 2017-11-02 19:03:34 UTC | #5

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