![]() ![]() ![]() I am currently working at Nexmo and we are working on the Chat API, which integrate multiple chat apps including Facebook, WeChat, LINE, etc. ![]() Now you can tailor your intents, add more features, and use the training feature for better results to make your bot more interesting! By the way… If you deploy your bot, make sure to change your webhook endpoints on both Facebook Developer app setting and API.ai Fulfillment. Yay, now you have your own Messenger bot that chats and answer weather info! Make sure to return is as JSON that api.ai will read from this webhook. Writing a Super Simple Chat BotĬonst request = require ( ' request ' ) function sendMessage ( event ) Otherwise, you are ready to get back to code. If you get a red icon with x at the Callback URL, it means the URL is not validated- either the URL is wrong or your node code is not properly running. In the dialog, fill out the (1) Callback URL with your ngrok URL, (2) the random string for validation (the one you’ve specified in your ‘GET’ route in the webhook.js), then (3) check messages.Ĭlick the Verify and Save. Then, at the Webhooks, (3) click the Setup Webhooks button: Click Get Started.Īt the Token Generation, (1) choose the page you just created from the dropdown menu, and it will generate a token (2) that you will need to include in your node code. Once your app is created, follow the steps to configure or skip it to your Dashboard.Ĭlick Add Product from the left menu, then choose Messenger. Give it a name and click the button, then fill out the required info: Choose a category, and select a sub category from the dropdown and fill out the required filed. You need a Facebook Page to set up your chat bot. This URL will be used as a Messenger webhook endpoint during the development, so you don’t need to deploy to a server until the app is completed.ĭownload ngrok, install it on your machine, and run with a port number, let’s use 5000: I choose ngrok to serves a localhost to a public URL because it is simple and easy to use. Setting Up a Temporary Webhook Endpoint with ngrok Live Demo - Scan the code below (the one looks sort of like a QR code) from the Messenger App on mobile, or access on m.me/tomomiBot from browser.īefore configuring your Messenger app on Facebook Developer, let’s create a bare minimum webhook with Node.js to get started. *(Updated on Jan 9: The bot has been approved by Facebook so you can try the bot!) * The source code (on tutorial-01 branch) is on GitHub. My step-by-step instruction uses Node.js, so if you’d like to follow the how-to, make sure Node.js is installed on your machine. Using API.ai Small Talk domain and creating a custom Intents.Setting up a Facebook Messenger App and writing the webhook.Writing apps with the services aren’t hard, however it requires some time reading the docs to figure out how to set them up, so I would like to share my experiences as this tutorial so hopefully you can write your bot in less time. Some examples are synonyms or related words under the same topic:Īn intent is a guess between what the user says and the action that the bot should take.Previously, I created a HTTP Status Cats bot for Slack (and its tutorial on Medium), and this time I tried with Facebook Messenger with some interesting 3rd party APIs, and I decide to give API.ai a try.Īs you may have heard of, API.ai, which recently acquired by Google, provides a conversational platform for natural language processing and it allows us to create bots easily. Give a description and select a language:Įntities gather words under concepts and parameters to simulate a natural conversation with users. This file will contain the logic for receiving and responding to messages from Facebook Messenger. In the fbchatbot directory, create a new file called views.py. In your Django project, run the following command: python manage.py startapp fbchatbot. It will be the conversational interface of your bot. Next, well create a new Django app for our chatbot. Here I explain how to create the above bot in 6 steps: I set up some keywords to answer questions around professional experience, education or hobbies: Through intents and entities, I tried to build a basic chatbot that displays information about my resumé. The platform that I liked the most was API.ai and I used it to build a bot for my Facebook Page Dinfografia . The previous post shows 5 tools that help to create Facebook Messenger chatbots. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |