I have recently launched my first messenger bot — Product Huntian. It was built using Chatfuel, API.AI, and Heroku in less than 10 days. Many Developers in the bot community have asked about integration of chatfuel with API.AI . This post will help you on the selection of tools for your bot development as well integration of different platform to get best out of them.
To develop my bot as a novice, I started to explore various bot development platforms and decided to go with API.AI. The main reasons that attracted me to use API.AI were :-
The problem with API.AI is that It is a trigger system. It only sends response when a user asks something. To add other features (as mentioned below) you need to write code for it.
- Welcome Message
- User profile details
- Persistent Menu
Going through all discussion on API.AI and then trying the solution suggested by others were timing consuming. To overcome all these hurdles, I started to explore Chatfuel. Chatfuel has all of these in-built functionalities in addition to broadcast and analytics features.
I decided to connect chatfuel with API.AI . Chatfuel has JSON API plugin that helps to send data to server and response back to the user. API.AI also has query request and response with JSON structure. The major problem is a JSON structure of response sent by API.AI is different than json structured accepted by Chatfuel.
Below is the sample example of comparison of structure for Send a Gallery to messenger.
Response accepts by Chatfuel JSON API
Response sends by API.AI
To solve this problem, I have written simple code in Python that converts response sends by API.AI into response accepts by chatfuel and deployed on Heroku. Now, when user says something in Facebook Messenger, the flow will be as follow-
Finally, I launched my bot on Product Hunt. After a one week of the launch –
- Featured on Product Hunt
- 92 upvotes on Product Hunt
- 190+ unique users
- 200+ views BotList
- 16th on Chatbottle
Building a chatbot is not as complex as you think. The major part is simplification of user interaction cases. Once you have figured out them, just use the tools to build the bot.
If you are working on chatbots and need any help or want to discuss ideas contact me on @keyul .