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

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

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,

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

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