The fulfillment endpoint will enable the app to handle asynchronous messages. Asynchronous messages will allow a bot to send a message proactively.
In the synchronous message, a bot will only answer to user's query. Eg if the user asks What is the customer care number? then the Bot will respond The customer care number is XXXX.
On the contrary, in asynchronous message, a bot will take the initiative to ask user what they what. Eg. A bot will proactively reach out to a new user and ask them Hello, How can I help you today?
To send asynchronous messages you can make use of custom-event in Dialogflow. The overall working will look something like this
-
A new event gets triggered using
custom-event. -
An intent is matched based on triggered event. This intent should have a
fulfillmentenabled which will send a request to ourRocket.Chat's Dialogflow App(or the fulfillment server can forward this request to the app). -
The app will catch this
fulfillment, parse the message and sessionId from the request and display it to the user.
-
URL
REST API URL can be found on Apps Page
Sample Url for eg:
http://localhost:3000/api/apps/public/783d8e4d-b06a-409a-aaf3-b37650dc0a26/fulfillment -
Method:
POST -
Input Data Format
The data format is the same as Dialogflow's webhook request defined here