-
Notifications
You must be signed in to change notification settings - Fork 5
Weather Bot Meets Facebook Messenger!
Amitha R edited this page Oct 13, 2018
·
4 revisions
- Chatbot App ---- (Send & Receive API) --- Facebook Messenger ----> User Interface (phone,laptop, etc);
- Create a Facebook Page
- Create a Facebook App
- Add the Messenger Platform to the app
- Code your chatbot / use as a service
- Link your chatbot app to the Messenger platform using webhooks.
- Test and Train
- Submit for Review
- Weather Bot (Server Instance) <------------> Facebook Messenger.
- The bot requires a server instance to interact with the facebook messenger.
- FBeamer - It is the interface being built for the Facebook Messenger platform.
- Facebook App -> My Apps -> Create a New App.
- Product Dashboard - Messenger - setup.
- Page Access Token
- Token Generation -> Select a page - Authorise access.
- Token is generated.
- Verify Token (Register chatbot API on the Messenger platform)
- webhooks are urls that accept get and post requests.
- Verify Token Generation
- In cmd
- node
- require('crypto').randomBytes(24).toString('hex')
- In cmd
- Page Access Token
- Register Webhooks
- Receive Messages from Messanger
- Send text Messages
- Send Image Messages
- Messenger [Register Webhook] --Get ---(mode - 'subscribe', verifytoken, challenge) ---> Bot [Receiver/send challenge] --- challenge --> Messenger.
- The interaction between Messenger and Bot requires a webhook to be accessible over a HTTPS connection.
- Inorder to setup HTTPS service locally require NGROK.
Messenger --- (https://something.ngrok.io) -----ngrok----- (http://localhost:3000) -----[webhook]-----> chatbot (local nodejs app).
- Start the ngrok -> http 3000
- In the facebook developers app - setup the webhook.
- Webhook - setup webhook
- Paste the ngrok url in the Callback URL.
- Verify Token - copy the created one.
- Subscription Fields - messages.
- verify -> main page - complete.
- cmd -> nodemon - "webhook registered".