safe-amethystS
Voiceflow2y ago
2 replies
safe-amethyst

Interactions in the Dashboard is different from the response of REST API endpoint

I want to integrate Voiceflow into my Flutter app through the use of REST API, but I am having issues with the different responses coming from the API response.

I want to achieve the exact chat flow (in terms of options given as responses to questions) in my app, as it is in the Dashboard.

The full URL I am using is https://general-runtime.voiceflow.com/state/user/$userId/interact

In the response, I am checking for the element where element['type'] == "text", in which I will show to the user as the response of the bot.

And using, element['type'] == "choice" to get the choices given in the response
final Map<String, dynamic> actualChoices = (res?.$2 as List).firstWhere((element) => element['type'] == "choice");


Now, the issue is that the choices I am getting from actualChoices['payload']['buttons'] is more like a default choice, and not the choice set for each question.

The point is that I need help understanding the API responses well, so that I can use the understanding to build my app, and hopefully build a package for Flutter apps.

Thank you.
Was this page helpful?