Legacy Dev Forum Posts

 View Only

Sign Up

POST api/v2/analytics/conversations/details/query interval question

  • 1.  POST api/v2/analytics/conversations/details/query interval question

    Posted 06-05-2025 18:16

    nrajan | 2020-02-08 00:21:43 UTC | #1

    Hi all, I have a question on the wording of the "interval" property for this post request. On this page: https://developer.mypurecloud.com/api/rest/v2/analytics/index.html

    For "interval" it says:

    (string required ) Specifies the date and time range of data being queried. Results will include conversations that both started on a day touched by the interval AND either started, ended, or any activity during the interval. Intervals are represented as an ISO-8601 string. For example: YYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss.

    My goal is to run a script that gets the conversation details for all calls that have ended in the last 30 minutes. I will be running this script every 30 minutes with interval "${$now - 30 minutes}/${now}"

    My question ... given this timeline:

    00:01:00 => conversation 1 starts 00:10:00 => conversation 1 ends 00:11:00 => conversation 2 starts 00:30:00 => POST for conversations details with interval 00:00:00/00:30:00 filter for where conversationEnd exists => This should only return conversation 1 00:35:00 => conversation 2 ends 01:00:00 => POST again for conversations details where conversationEnd exists in last 30 minutes ... will this return conversation 2? or is conversation 2 lost with this logic?

    (also ignore paging)

    Thank you for any help!

    Edit: follow up question say a survey is sent for conversation 1, and is filled out later the same day. would this cause conversation 1 to appear again in the same interval that the survey was filled?

    Edit: follow up follow up question if the former is the case, is it possible to use gt / lt on datetimes for the filters so I do not end up streaming the same conversation again when a survey is answered within the same day as it is sent?

    Another thing we could do is delay all surveys sent by 24 hours in the survey flow (putting a Wait action in architect). I do not know if this is a typical purecloud design pattern to have a Survey invite idle for a day before sending the survey. Let me know!


    tim.smith | 2020-02-10 22:48:44 UTC | #2

    nrajan, post:1, topic:7095
    00:11:00 => conversation 2 starts 00:35:00 => conversation 2 ends 01:00:00 => POST again for conversations details where conversationEnd exists in last 30 minutes ... will this return conversation 2? or is conversation 2 lost with this logic?

    If your interval is 00:30:00-01:00:00, it will include conversation 2 as it both started on a day of the interval and had activity within that interval.

    nrajan, post:1, topic:7095
    say a survey is sent for conversation 1, and is filled out later the same day. would this cause conversation 1 to appear again in the same interval that the survey was filled?

    If it's modifying the data in the conversation object, yes.

    nrajan, post:1, topic:7095
    if the former is the case, is it possible to use gt / lt on datetimes for the filters so I do not end up streaming the same conversation again when a survey is answered within the same day as it is sent?

    If you're performing an action that must not be performed twice on the same conversation, you'd be wise to track which conversations have been handled so you don't act on them again. There are conditions that can cause a conversation to be updated after an end time has been assigned.


    nrajan | 2020-02-11 00:50:54 UTC | #3

    thanks so much for your response, Tim! To clarify - "interval" does not specify "start time" and "end time" interval, and there is no way to filter based on start and end time?


    tim.smith | 2020-02-11 16:52:44 UTC | #4

    nrajan, post:3, topic:7095
    and there is no way to filter based on start and end time?

    Assuming you mean the conversationStart and conversationEnd properties, those are dimensions and dimensions can only be filtered by exact values or (not)exists. Greater/less than filters can only be applied to metrics. See https://developer.mypurecloud.com/api/rest/v2/analytics/conversation.html#dimensions.


    nrajan | 2020-02-14 22:09:36 UTC | #5

    Thanks Tim, I really appreciate your prompt responses despite seemingly being a one man show over here!


    system | 2020-03-16 22:09:21 UTC | #6

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