I am trying to figure out how I can embed Google Actions responses, such as the carousel, in a webhook response for DialogFlow.
As epxlained in Is there a way to simply
For starters - rest assured. You need only one webhook and that is the one that you're already using to work with Dialogflow. Responses will go through Dialogflow, but you need to make sure you've added an Intent to handle it.
The intent needs to be set to use an Event of actions_intent_OPTION
. You should not give it any training phrases, but do make sure you set the Action and turn on the fulfillment selector.
When you handle this in your webhook, if you're using the Node.js API, the key of the option will be in a context named actions_intent_option
. You can access it with something like this:
const param = app.getContextArgument('actions_intent_option', 'OPTION').value;
If you prefer to use JSON, you can find the information under
originalRequest.data.inputs[0].arguments[0].textValue