Legacy Dev Forum Posts

 View Only

Sign Up

Data action to lookup interaction ID of live voice or callback call from a flow

  • 1.  Data action to lookup interaction ID of live voice or callback call from a flow

    Posted 06-05-2025 18:44

    Simon_McKenzie | 2023-09-04 10:30:52 UTC | #1

    /api/v2/analytics/conversations/details/query

    Data action created to lookup the interaction ID of a live / open voice or callback interaction, regardless if the client has called us (ANI) or an Agent has called them (DNIS) - includes voice calls and callbacks.

    The data action runs fine in the API explorer > query builder. The Data action works fine if i manually enter the TO-FROM datetime directly into the action itself. I am stuck on how to automate the DATE lookup field when my architect flow calls the data action.

    (1) How do we configure it to look at calls for today given i am after live calls that have not ended yet?

    (2) The API Explorer Query builder only works if a DateTime is set, but can the Data action be setup without datetime given we can achieve the same results by simply filtering on ANI / DNIS and "conversationEnd" = "notExists" is used - meaning its a live call?.

    Background I need the interaction ID of the original call to be set as an External TAG on the call once it has been transferred to a special Survey Queue. Normally a call transferred will contain this information but i am doing it another way for the privacy of survey results

    DATA action

    { "interval": "${input.Date}", "order": "desc", "orderBy": "conversationStart", "paging": { "pageSize": "25", "pageNumber": 1 }, "segmentFilters": [ { "type": "or", "clauses": [ { "type": "and", "predicates": [ { "type": "dimension", "dimension": "ani", "operator": "matches", "value": "${input.ANI}" } ] }, { "type": "or", "predicates": [ { "type": "dimension", "dimension": "dnis", "operator": "matches", "value": "${input.ANI}" } ] } ] } ], "conversationFilters": [ { "type": "and", "predicates": [ { "type": "dimension", "dimension": "conversationEnd", "operator": "notExists", "value": null } ] } ] }

    Architect Flow - this is incomplete of course. (awaiting your precious insights) :wink:


    Jerome.Saint-Marc | 2023-09-04 15:54:50 UTC | #2

    Hello,

    The interval parameter/attribute is mandatory in the Analytics Query for Conversation Details ( /api/v2/analytics/conversations/details/query).

    What you can do is to leverage Architect (expressions) to create the appropriate interval/date string. In this older post, the purpose was to create a one month interval. You can use the same approach for one day.

    Define a string variable (using Update Data block) to hold your interval/date with the following expression: ToString(AddDays(GetCurrentDateTimeUtc(), -1)) + "/" + ToString(GetCurrentDateTimeUtc()) This will produce an interval (24 hours ago to now).

    Regards,


    Simon_McKenzie | 2023-09-05 00:28:36 UTC | #3

    Thats perfect info thanks Jerome. I am trying it out ToString(AddHours(GetCurrentDateTimeUtc(), -2)) + "/" + ToString(GetCurrentDateTimeUtc()) Your linked article has a lot of good info too. Regards Simon


    system | 2023-10-06 00:28:55 UTC | #4

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