Custom Data Action that can generate a date interval dynamically to pass that as input to API

Hi,

I have a requirement to query conversation details for given ANI and DNIS in the last 24 hours window. I have created a custom action the takes the interval, ANI and DNIS input and query the conversation details using API /api/v2/analytics/conversations/details/query.

However, the challenge is that this custom data action needs to be called from an outbound pre-call rule and I cannot pass a dynamic interval value in the interval input parameter as the rule doesn't allow me to enter an expression using built-in functions. It only has an option to select columns from the contact list and even if I add the interval column to the contact list, the values cannot to generated in runtime. So I need a way to configure the custom data action in such a way that the last 24 hours is dynamically derived and passed as input to the API.

Please let me know if there is a way to do that.

Thanks & Regards
Dhana

Hi @dvasudevan
This forum focuses on Genesys Cloud API related questions. Core app questions are better to ask in the Community forum. In addition, you can suggest new features such as dynamic rule inputs using expressions, or maybe dynamic default input values for data actions, using the Ideas portal

Hi @jacobshaw,

I was asked to raise this in the developer forum as a response to the ticket I opened with Genesys support. Thanks for your direction, I will raise it in the community forum.

Thanks & Regards
Dhana

@dvasudevan I think there was a bit of a misunderstanding in what you were asking for. Knowing that Care sent you here to discuss a workaround helps give some context. The analytics query requiring a discreet value for the interval and the outbound data action being unable to generate a dynamic input are facts that cannot be changed, regardless of if it's discussed via Care or a forum.

Since invoking the API directly in a data action doesn't give you what you need, the typical solution is for you to write your own middleware to bridge that gap. For example, you could write an AWS lambda function exposed via API Gateway. The data action can make the request to your function, your function generates the interval based on the current time and makes the request to the API, then returns the response back to the data action. This approach also gives you the opportunity to manipulate the API response in any way you like before returning it so you can make the response simple to consume (as opposed to JSON-pathing your way through an analytics payload).

One other thing you can do is create an idea at https://genesyscloud.ideas.aha.io/ideas for this. If there is customer demand for this capability it would be something that we could add.

--Jason

Thanks @tim.smith and @Jason_Mathison for your responses. I have raised a product idea for this - https://genesyscloud.ideas.aha.io/ideas/OP-I-1605

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