Reputation: 444
I have created a simple Agent in Dialogflow CX. When the user enters a city name then it should list pin codes that belong to the entered city. In order to get the pin codes, I have performed a webhook POST request. The webhook URL returns the required pin code in JSON format but I don't know how I should display it in the chat.
Can I get some tutorial links? OR What changes I need to add in the Agent inorder to read the JSON response.
Upvotes: 2
Views: 3087
Reputation: 670
Don't know if this will actually solve your problem, but I recently had a similar doubt to yours and this cleared it up for me.
From Google's Documentation for CX Webhooks, the response message for a webhook call is structured with a fulfillment_response field: this contains what the bot will say to the user if the webhook call is successful.
So, to answer your question what should happen is this:
Hope this solved your doubts!
Upvotes: 2