On this repo, you will find a very small Dialogflow fulfillment that allows integrating your chatbots with IFTTT applets.
Dialogflow is a Google platform that facilitates the creation of chatbots. You can configure your intents and replies easily with a visual interface. You can connect your Dialogflow chatbots with a lot of platforms ( Facebook Messenger, Telegram, Google Assistant, … ).
If you want to create a chatbot that speaks with third-party services ( Gmail, Spotify, … ) you need to create a fulfillment webhook and develop a connector on your servers.
The objective of this project is to facilitate the integration of third-party services with the help of IFTTT.
IFTTT is a platform where you can configure connections between hundreds of services.
On this example, we are going to create a small poll with a chatbot. The replies will be saved on Google Drive.
- Create a new IFTTT account.
- Go to IFTTT New Applet.
- Click on
+this
. - Search
webhooks
. - Select
Receive a web request
. - Write an event name. We are going to use
poll_completed
. - Click on
+that
. - Search
Google Sheets
. - Select
Add a row to spreadsheet
. - Click
Create action
. - Click
Finish
.
- Create a Heroku account.
- Click on this button:
- Write an app name and choose a region.
- Click
Deploy app
- Wait until webhook be deployed.
- Click on
View
and you will be redirected to your app. Default user istest
and default password istest
. Remember change them. - This control panel will allow you to connect your chatbot intents to IFTTT applets.
- Open a browser and log in to Dialogflow.
- Click Create agent in the left menu.
- Enter your agent's name, default language, and default time zone, then click the Create button.
- Create a new intent with this features:
-
Intent name. We will use
bot.example.poll
. -
Some training phrases. For example:
i want to complete the poll
,complete the poll
,reply the poll
. -
Two required params:
- value1 - @sys.given-name - $value1. Prompt:
Your name?
. - value2 - @sys.number - $value2. Prompt:
Your age?
.
- value1 - @sys.given-name - $value1. Prompt:
-
A response: Thanks for reply our survey.
-
- Activate Fulfillment on
Fulfillment > Enable webhook call for this intent.
. - Save intent.
- Insert your Fulfillment URL on
Fulfillment
section. Fulfillment URL appears on Heroku control panel (you installed it on previous section).
- Go to Heroku control panel.
- Insert and Save
IFTTT Events URL
. - Insert connections. The first row contains Dialogflow intents. The second row contains IFTTT events. On this example you should insert:
- Intent:
bot.example.poll
. - Action:
poll_completed
.
- Intent:
- Save Connections.
- Go to
Integrations
on Dialogflow. - Enable Web Demo.
- Click on
https://bot.dialogflow.com/...
- Write
i want to complete the poll
.