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)

I have also created a series of videos explaining this.


This website contains affiliate links. See the disclosure page for more details. 
Check out my free YouTube courses

Dialogflow CX Beginner Tutorial

Dialogflow ES vs CX using a Decision Tree Bot

Intro to NLU for technical non-programmers

Better Dialogflow ES Bots Using the CTFS Framework

Search the autogenerated transcripts of all my YouTube videos
"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
In this free course, I provide some tips for managing large Dialogflow ES bots without compromising on accuracy.

Similar Posts