Home / DialogFlow ES / How to send rich responses from webhook to Dialogflow Messenger
DialogFlow ES | Website Bots

How to send rich responses from webhook to Dialogflow Messenger

Recently, I got this question on YouTube:

i have added rich responses code in my dialogflow fulfillment. but when i am testing with dialogflow messanger integration, it is not diaplaying any images, cards on dialogflow messanger. Can you tell me what version i need to use?

Based on the question, I suppose this person is using the Dialogflow fulfillment library.

I recommend people avoid using the fulfillment libraries for Dialogflow unless they are building a voice bot. Since this question is about Dialogflow Messenger, it is recommended that you don’t use the fulfillment library.

There are three reasons why I recommend you avoid the fulfillment library:

a) it makes things unnecessarily opaque

b) the fulfillment library is rarely up to date with the latest features

c) if something in the fulfillment library doesn’t work, you will end up doing MUCH MORE work than if you had just avoided it in the first place

So what do I recommend instead?

I suggest simply understanding the JSON format of the response and constructing it in your code. This way, it is much easier to maintain over time.

The steps are fairly straight forward:

1 First type out the appropriate JSON inside your Custom Payload block (i.e. first hard code the response)

2 Trigger the intent in the Dialogflow Messenger

3 From the History module, get the JSON which was sent as a response

4 Paste this JSON into your webhook response generator code (and make suitable updates so it is dynamic)

You can get some sample code for a Python webhook here.

<— End of article —>

This website contains affiliate links. See the disclosure page for more details. 
"The magic key I needed as a non-programmer"

The custom payload generator was the magic key I needed (as a non-programmer) to build a good demo with rich responses in DialogFlow Messenger. I've only used it for 30 minutes and am thrilled. I've spent hours trying to figure out some of the intricacies of DialogFlow on my own. Over and over, I kept coming back to Aravind's tutorials available on-line. I trust the other functionalities I learn to use in the app will save me additional time and heartburn.

- Kathleen R
Cofounder, gathrHealth
"Much clearer than the official documentation to be honest"

Thanks a lot for the advice (of buying and following your videos)! They helped a lot indeed. Everything is very clear when you explain, much clearer than the official documentation to be honest 🙂

Neuraz T
Review for Learn Dialogflow CX
"I will strongly recommend this course because even I can learn how to design chatbot (no programming background)"

I think Aravind really did a great job to introduce dialogflow to people like me, without programming background. He organizes his course in very clear manner since I have been a college professor for 20 years. It is very easy for me to recognize how great Aravind’s course is! Very use-friend and very easy to follow. He doesn’t have any strong accent when he gives the lectures. It is so easy for me to understand. Really appreciate it.

Yes, I will strongly recommend this course because even I can learn how to design chatbot (no programming background) after studying Avarind’s course, you definitely can!

Ann Cai
Review for Learn Dialogflow ES

Similar Posts