SlideShare a Scribd company logo
1 of 25
Ram Murat Sharma, @rammrms
rammurat.rms.sharma0@gmail.com
Agenda
 Introduction
 Bots
 Facebook bots
 Prerequisite
 Demo
 CNN
 Installations
 Facebook page
 Ngrok (Secure tunnels to
localhost)
 Node server
 Facebook presentation layer
(Structured Messages)
 Facebook templates
 Do we need a framework
 Framework design
 Framework application
flow
 File structure
 WIT API
 Firebase database
 Future of bots
 Framework source code
Introduction to chat bots
 Bots are simple artificial intelligence systems that you interact with via
text. Those interactions can be straight forward, like asking a bot to give
you a weather report, or more complex, like having one troubleshoot a
problem with your internet service.
 Short for chat robot, a computer program that simulates human
conversation, or chat, through artificial intelligence.
 Chat bots are used in applications such as ecommerce customer service,
call centers and Internet gaming. Chat bots used for these purposes are
typically limited to conversations regarding a specialized purpose and not
for the entire range of human communication.
Introduction to FB Bots
 The Messenger Platform gives you the ability to have conversations with people on
Messenger. We've added new tools for you to build and promote your bot so you can
create a custom experience for your unique audience.
 Why Facebook bot?
 Web plugins - Using plugins, codes and links people can discover your bot and start
conversations.
 Customer Matching - Customer matching allows you to reach people in Messenger if
you have their phone number and their consent to be contacted by you.
 Structured Templates - You can format your messages in a variety of ways. Send
simple text and images, or use our structured templates to customize your message
bubbles.
 User Controls - Provides people with even more ways to control the conversation and
make sure they can reach the businesses they care about.
Prerequisite
 Good JavaScript knowledge
 Ngrok installed(Secure tunnels to localhost)
 Facebook page
 Node server running
 WIT account (NLP)
 Firebase account (Google database)
 Browser
Demo (CNN - https://www.facebook.com/cnn/)
CNN was among the first publishers to launch a bot in April, which is available to its global
audience. CNN currently has a Facebook audience of 22 ML people, and CNN International has 12
ML. You can ask for news as per your interest by writing, for ex: “Latest on Donald Trump”
Let’s do some
installations first
Installation : Facebook page
 Go to your app dashboard page - https://developers.facebook.com/apps/
 Create new app by clicking messenger tab
 Generate your access token
 Subscribe your page for webhook
 Create your callback url after installing ngrok and set your token in config file
 Update your webhook details as shown below under webhook tab on Facebook
page
You must need a Facebook page to start with, which provides you complete
features including a button to start your chat.
Installation : Ngrok
You also need to setup a secure tunnel to your localhost server. Ngrok is a tool
that allows you to easily expose your localhost server to the outside world.
Make sure your firewall won’t block this.
 Download ngrok - https://ngrok.com/
 Open command prompt and run “ngrok http 80”
 Copy randomly generated domain name to link with Facebook
webhook, here it is “https://9d71cd26.ngrok.io”
Installation : Node server
You also need to setup a node server on your localhost, which is responsible to
handle and respond all the client/user requests. This server will act as a
webhook or callback handler to Facebook API.
 Download nodejs - https://nodejs.org/en/
 Download framework from github
 Go to synced folder
 Open command prompt and run “npm install”
 “/webhook/” with post request is implemented to handle all the
request.
Facebook
Messenger Platform
Facebook Presentation layer
Template types
 Text message
 Audio message
 Video message
 Option List
 Carousel
 Quick replies
 Persistent Menu
 Airlines templates
Facebook messenger platform provides presentation layer, which has all the
required templates. You don’t need to write any HTML or CSS for this.
Structured Messages :- Structured messages support multiple templates to enable
different kinds of use cases. The button and generic template can render buttons
that open a URL or make a back-end call to your webhook. And the receipt
template can be used to send the receipt.
Facebook Presentation layer
These templates contains Normal text, Option list, Quick replies and share location.
Facebook Presentation layer
These templates contains Order receipt, Dialog popup and Airlines design.
Do we need a Framework?
Imagine, you need to develop couple of chatbots which will
help you to book movie tickets, order food like pizza or burger
and book your table in some restaurant.
Problem : You need to setup server, client, configuration file,
define templates, structure your code, integrate your chatbots
with NPL processors/engines and store chat history somewhere
to cloud server.
Solution : This framework provides pre-designed Facebook
templates, built-in integration of system with WIT (NPL engine)
and cloud database (Google Firebase) with your application. All
you need is to put your questions in some JSON file, and load it
in JavaScript object and run your application. You can further
map your questions with WIT API as per your application flow.
The framework will automatically save the chat history on cloud
server i.e. firebase.
Facebook Templates
 Text message template
In this template all you need is “message” that you want to send and a 16
digit user’s Facebook id like “1100223344556677” to identify the user
 Option list template
The list template is a template that allows you to present a set of items
vertically. It can be rendered in two different ways. One list comes with action
buttons, for ex:- Add to cart, Buy now etc. while the other one comes with
normal list, with or without a product image
 Carousel list template
 Carousel list template is generic template and follows almost the same
structure of option list, but it displays it’s data in carousel instead.
 Receipt template
 Receipt templates are used to send order confirmation to the API, with the
transaction summary and description for each item.
Facebook Templates
Option List Template Receipt Template
Framework Design
 Presentation layer
Presentation layer is provided by Facebook
only, no need to create any html or style.
 Application Layer
Application layer plays the role of webhook
handler, means it handles all the postback
reply and direct text messages of user.
 WIT layer
WIT layer or API is used to process human
natural language
 Service Layer
Service layer is responsible to send messages
to the user, process user request and apply
specified template as per requirement.
 Data Layer
Data can be drive either from any static JSON
file or firebase, both methods are available
with the framework.
Framework Application Flow
Framework files description
 Configuration file
This file is created to store all the configuration of framework including Facebook access token,
WIT API token, firebase option settings, server details like port, IP address and application flow
mapping.
 Chat response handler
This handler is the main handler which handles all the requests from Facebook including post-
back and direct text request. This handler also manages what could be the next question to ask.
 Template manager
Template manager contains all the pure functions and return templates as per Facebook
guidelines.
 Service handler
This handler is responsible to save user conversation, send messages, and map Facebook
templates.
 Data origin/load
Data can be provided to system either from static JSON file or any database like firebase. This
framework has an option to ingrate anyone of the these option.
 User class handler
User class is created to store user information and his/her activities after he/she start the chat
session.
Utterance (WIT.AI)
 Wit.ai makes it easy for developers to build applications and devices that you can talk or text to.
Wit.ai learns human language from every interaction. They have recently extends their previous
intent-oriented approach to story oriented approach.
 In Wit.ai we can use Entities, Intents, Context and Actions concepts that together form the model
based on Machine Learning, and statistics can be used for understanding the language.
Database(Google Firebase)
Firebase is a mobile platform that helps you quickly develop high-quality apps, grow your user
base, and earn more money. Firebase is made up of complementary features that you can mix-
and-match to fit your needs. The company was acquired by Google in October 2014, and added a
significant number of new features in by May 2016. Firebase can be the fastest and one of the
recommended option for chatbot applications, whenever you want to save your chat history.
Framework Source Code
For more information or quick documentation and source code, you can
check out the below link on GitHub.
https://github.com/rammurat/facebook-bot-framework
Thank You

More Related Content

What's hot

Introduction to Chat Bots
Introduction to Chat BotsIntroduction to Chat Bots
Introduction to Chat BotsAlyona Medelyan
 
Building intelligent chat bot with microsoft bot framework
Building intelligent chat bot with microsoft bot frameworkBuilding intelligent chat bot with microsoft bot framework
Building intelligent chat bot with microsoft bot frameworkRukshan Dangalla
 
An introduction to Microsoft Bot Framework
An introduction to Microsoft Bot FrameworkAn introduction to Microsoft Bot Framework
An introduction to Microsoft Bot FrameworkTaswar Bhatti
 
Tokyo azure meetup #13 build bots with azure bot services
Tokyo azure meetup #13   build bots with azure bot servicesTokyo azure meetup #13   build bots with azure bot services
Tokyo azure meetup #13 build bots with azure bot servicesTokyo Azure Meetup
 
Instant Messenger Using Adobe Flash Lite
Instant Messenger Using Adobe Flash LiteInstant Messenger Using Adobe Flash Lite
Instant Messenger Using Adobe Flash Litemohnish_basha
 
Build a Great Conversationalist
Build a Great ConversationalistBuild a Great Conversationalist
Build a Great ConversationalistLorenzo Barbieri
 
Build an Intelligent Bot (Node.js)
Build an Intelligent Bot (Node.js)Build an Intelligent Bot (Node.js)
Build an Intelligent Bot (Node.js)Sorin Peste
 
Artificially Intelligent chatbot Implementation
Artificially Intelligent chatbot ImplementationArtificially Intelligent chatbot Implementation
Artificially Intelligent chatbot ImplementationRakesh Chintha
 
What an RP Wants, Part 2
What an RP Wants, Part 2What an RP Wants, Part 2
What an RP Wants, Part 2Joseph Smarr
 
Practical Microsoft Bot Framework for Office 365 developers
Practical Microsoft Bot Framework for Office 365 developersPractical Microsoft Bot Framework for Office 365 developers
Practical Microsoft Bot Framework for Office 365 developersOlli Jääskeläinen
 
Developing Intelligent Chatbots using RASA, OW2con'19, June 12-13, 2019 in Paris
Developing Intelligent Chatbots using RASA, OW2con'19, June 12-13, 2019 in ParisDeveloping Intelligent Chatbots using RASA, OW2con'19, June 12-13, 2019 in Paris
Developing Intelligent Chatbots using RASA, OW2con'19, June 12-13, 2019 in ParisOW2
 
Chatbot development with Microsoft Bot Framework
Chatbot development with Microsoft Bot FrameworkChatbot development with Microsoft Bot Framework
Chatbot development with Microsoft Bot FrameworkMd. Mahedee Hasan
 
김영욱 - Microsoft Bot Framework [WSConf. Seoul 2017]
김영욱 - Microsoft Bot Framework [WSConf. Seoul 2017]김영욱 - Microsoft Bot Framework [WSConf. Seoul 2017]
김영욱 - Microsoft Bot Framework [WSConf. Seoul 2017]WSConf.
 
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s PerspectiveESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s PerspectiveThomas Gölles
 

What's hot (20)

Bots presentation
Bots presentationBots presentation
Bots presentation
 
Introduction to Chat Bots
Introduction to Chat BotsIntroduction to Chat Bots
Introduction to Chat Bots
 
Building intelligent chat bot with microsoft bot framework
Building intelligent chat bot with microsoft bot frameworkBuilding intelligent chat bot with microsoft bot framework
Building intelligent chat bot with microsoft bot framework
 
Whats a Chat bot
Whats a Chat botWhats a Chat bot
Whats a Chat bot
 
20160930 bot framework workshop
20160930 bot framework workshop20160930 bot framework workshop
20160930 bot framework workshop
 
An introduction to Microsoft Bot Framework
An introduction to Microsoft Bot FrameworkAn introduction to Microsoft Bot Framework
An introduction to Microsoft Bot Framework
 
Tokyo azure meetup #13 build bots with azure bot services
Tokyo azure meetup #13   build bots with azure bot servicesTokyo azure meetup #13   build bots with azure bot services
Tokyo azure meetup #13 build bots with azure bot services
 
Instant Messenger Using Adobe Flash Lite
Instant Messenger Using Adobe Flash LiteInstant Messenger Using Adobe Flash Lite
Instant Messenger Using Adobe Flash Lite
 
Chatbot ppt
Chatbot pptChatbot ppt
Chatbot ppt
 
Build a Great Conversationalist
Build a Great ConversationalistBuild a Great Conversationalist
Build a Great Conversationalist
 
AI Machine vs Human
AI Machine vs HumanAI Machine vs Human
AI Machine vs Human
 
Dialogflow
DialogflowDialogflow
Dialogflow
 
Build an Intelligent Bot (Node.js)
Build an Intelligent Bot (Node.js)Build an Intelligent Bot (Node.js)
Build an Intelligent Bot (Node.js)
 
Artificially Intelligent chatbot Implementation
Artificially Intelligent chatbot ImplementationArtificially Intelligent chatbot Implementation
Artificially Intelligent chatbot Implementation
 
What an RP Wants, Part 2
What an RP Wants, Part 2What an RP Wants, Part 2
What an RP Wants, Part 2
 
Practical Microsoft Bot Framework for Office 365 developers
Practical Microsoft Bot Framework for Office 365 developersPractical Microsoft Bot Framework for Office 365 developers
Practical Microsoft Bot Framework for Office 365 developers
 
Developing Intelligent Chatbots using RASA, OW2con'19, June 12-13, 2019 in Paris
Developing Intelligent Chatbots using RASA, OW2con'19, June 12-13, 2019 in ParisDeveloping Intelligent Chatbots using RASA, OW2con'19, June 12-13, 2019 in Paris
Developing Intelligent Chatbots using RASA, OW2con'19, June 12-13, 2019 in Paris
 
Chatbot development with Microsoft Bot Framework
Chatbot development with Microsoft Bot FrameworkChatbot development with Microsoft Bot Framework
Chatbot development with Microsoft Bot Framework
 
김영욱 - Microsoft Bot Framework [WSConf. Seoul 2017]
김영욱 - Microsoft Bot Framework [WSConf. Seoul 2017]김영욱 - Microsoft Bot Framework [WSConf. Seoul 2017]
김영욱 - Microsoft Bot Framework [WSConf. Seoul 2017]
 
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s PerspectiveESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
 

Viewers also liked

Microsoft Bot framework 概要
Microsoft Bot framework 概要Microsoft Bot framework 概要
Microsoft Bot framework 概要Koichiro Sasaki
 
Office365とオンプレミス製品の共存(MVP Community Camp 2015)
Office365とオンプレミス製品の共存(MVP Community Camp 2015)Office365とオンプレミス製品の共存(MVP Community Camp 2015)
Office365とオンプレミス製品の共存(MVP Community Camp 2015)Genki WATANABE
 
Facebook Messenger: The Path to Monetization
Facebook Messenger: The Path to Monetization Facebook Messenger: The Path to Monetization
Facebook Messenger: The Path to Monetization Alan Alden
 
Dockerを使ってOSコマンドインジェクションが出来るSlack botを作った話
Dockerを使ってOSコマンドインジェクションが出来るSlack botを作った話Dockerを使ってOSコマンドインジェクションが出来るSlack botを作った話
Dockerを使ってOSコマンドインジェクションが出来るSlack botを作った話Tomoya Kita
 
【Mobidays】KM-Report 2016年9月
【Mobidays】KM-Report 2016年9月【Mobidays】KM-Report 2016年9月
【Mobidays】KM-Report 2016年9月Mobidays
 
サンタBot説明
サンタBot説明サンタBot説明
サンタBot説明okazakit
 
Facebook bot(20160518)
Facebook bot(20160518)Facebook bot(20160518)
Facebook bot(20160518)Shoko Kondo
 
LINE@ 新手帳號設定五步驟介紹
LINE@ 新手帳號設定五步驟介紹LINE@ 新手帳號設定五步驟介紹
LINE@ 新手帳號設定五步驟介紹LINEATTWN
 
我が家を支えるChatOps
我が家を支えるChatOps我が家を支えるChatOps
我が家を支えるChatOps空宙 小笠原
 
やるおがtriphone HMMを作るようです
やるおがtriphone HMMを作るようですやるおがtriphone HMMを作るようです
やるおがtriphone HMMを作るようですShinya Shimizu
 
Slackとgoogle appsscript(js)で作る俺の秘書ハンズオン
Slackとgoogle appsscript(js)で作る俺の秘書ハンズオンSlackとgoogle appsscript(js)で作る俺の秘書ハンズオン
Slackとgoogle appsscript(js)で作る俺の秘書ハンズオン健一 茂木
 
コンカーを職場に選ぶ理由 (2016年6月版)
コンカーを職場に選ぶ理由 (2016年6月版)コンカーを職場に選ぶ理由 (2016年6月版)
コンカーを職場に選ぶ理由 (2016年6月版)Concur Japan
 
Facebook Messenger Platform で始める Bot 開発
Facebook Messenger Platform で始める Bot 開発Facebook Messenger Platform で始める Bot 開発
Facebook Messenger Platform で始める Bot 開発sters
 
Bot に家計を任せる
Bot に家計を任せるBot に家計を任せる
Bot に家計を任せるYuki Ishikawa
 
Bot mashup world LT Bot ✖️ HMM
Bot mashup world LT  Bot ✖️ HMMBot mashup world LT  Bot ✖️ HMM
Bot mashup world LT Bot ✖️ HMMRyota Sakamoto
 
千里之行,始於足下:動手寫自己的App
千里之行,始於足下:動手寫自己的App千里之行,始於足下:動手寫自己的App
千里之行,始於足下:動手寫自己的AppSmallr Huang
 
Concur App Center : 全国タクシーアプリ コンカー連携方法
Concur App Center : 全国タクシーアプリ コンカー連携方法Concur App Center : 全国タクシーアプリ コンカー連携方法
Concur App Center : 全国タクシーアプリ コンカー連携方法Concur Japan
 

Viewers also liked (20)

Microsoft Bot framework 概要
Microsoft Bot framework 概要Microsoft Bot framework 概要
Microsoft Bot framework 概要
 
Office365とオンプレミス製品の共存(MVP Community Camp 2015)
Office365とオンプレミス製品の共存(MVP Community Camp 2015)Office365とオンプレミス製品の共存(MVP Community Camp 2015)
Office365とオンプレミス製品の共存(MVP Community Camp 2015)
 
Chatbot Meetup
Chatbot MeetupChatbot Meetup
Chatbot Meetup
 
Facebook Messenger: The Path to Monetization
Facebook Messenger: The Path to Monetization Facebook Messenger: The Path to Monetization
Facebook Messenger: The Path to Monetization
 
Dockerを使ってOSコマンドインジェクションが出来るSlack botを作った話
Dockerを使ってOSコマンドインジェクションが出来るSlack botを作った話Dockerを使ってOSコマンドインジェクションが出来るSlack botを作った話
Dockerを使ってOSコマンドインジェクションが出来るSlack botを作った話
 
【Mobidays】KM-Report 2016年9月
【Mobidays】KM-Report 2016年9月【Mobidays】KM-Report 2016年9月
【Mobidays】KM-Report 2016年9月
 
サンタBot説明
サンタBot説明サンタBot説明
サンタBot説明
 
Facebook bot(20160518)
Facebook bot(20160518)Facebook bot(20160518)
Facebook bot(20160518)
 
LINE@ 新手帳號設定五步驟介紹
LINE@ 新手帳號設定五步驟介紹LINE@ 新手帳號設定五步驟介紹
LINE@ 新手帳號設定五步驟介紹
 
我が家を支えるChatOps
我が家を支えるChatOps我が家を支えるChatOps
我が家を支えるChatOps
 
やるおがtriphone HMMを作るようです
やるおがtriphone HMMを作るようですやるおがtriphone HMMを作るようです
やるおがtriphone HMMを作るようです
 
Slackとgoogle appsscript(js)で作る俺の秘書ハンズオン
Slackとgoogle appsscript(js)で作る俺の秘書ハンズオンSlackとgoogle appsscript(js)で作る俺の秘書ハンズオン
Slackとgoogle appsscript(js)で作る俺の秘書ハンズオン
 
コンカーを職場に選ぶ理由 (2016年6月版)
コンカーを職場に選ぶ理由 (2016年6月版)コンカーを職場に選ぶ理由 (2016年6月版)
コンカーを職場に選ぶ理由 (2016年6月版)
 
Facebook Messenger Platform で始める Bot 開発
Facebook Messenger Platform で始める Bot 開発Facebook Messenger Platform で始める Bot 開発
Facebook Messenger Platform で始める Bot 開発
 
Bot に家計を任せる
Bot に家計を任せるBot に家計を任せる
Bot に家計を任せる
 
Intro to Bot Framework
Intro to Bot FrameworkIntro to Bot Framework
Intro to Bot Framework
 
Bot mashup world LT Bot ✖️ HMM
Bot mashup world LT  Bot ✖️ HMMBot mashup world LT  Bot ✖️ HMM
Bot mashup world LT Bot ✖️ HMM
 
千里之行,始於足下:動手寫自己的App
千里之行,始於足下:動手寫自己的App千里之行,始於足下:動手寫自己的App
千里之行,始於足下:動手寫自己的App
 
DDoS対策の自動化
DDoS対策の自動化DDoS対策の自動化
DDoS対策の自動化
 
Concur App Center : 全国タクシーアプリ コンカー連携方法
Concur App Center : 全国タクシーアプリ コンカー連携方法Concur App Center : 全国タクシーアプリ コンカー連携方法
Concur App Center : 全国タクシーアプリ コンカー連携方法
 

Similar to Facebook Messenger Platform Framework

facebookthrift-151001153400-lva1-app6891.pptx
facebookthrift-151001153400-lva1-app6891.pptxfacebookthrift-151001153400-lva1-app6891.pptx
facebookthrift-151001153400-lva1-app6891.pptxPrasannaKumarpanda2
 
Automatic answer checker
Automatic answer checkerAutomatic answer checker
Automatic answer checkerYesu Raj
 
Online advertising management system
Online advertising management systemOnline advertising management system
Online advertising management systemYesu Raj
 
Online advertising management system
Online advertising management systemOnline advertising management system
Online advertising management systemYesu Raj
 
Final Project In Instant messaging app that also brings you the intel...
Final Project In Instant  messaging  app  that   also  brings  you  the intel...Final Project In Instant  messaging  app  that   also  brings  you  the intel...
Final Project In Instant messaging app that also brings you the intel...vinayh.vaghamshi _
 
How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...
 How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi... How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...
How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...Aimore Technologies
 
An end-to-end experience of Windows Phone 7 development (Part 2)
An end-to-end experience of Windows Phone 7 development (Part 2)An end-to-end experience of Windows Phone 7 development (Part 2)
An end-to-end experience of Windows Phone 7 development (Part 2)rudigrobler
 
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING PamRobert
 
Microsoft teams & bot framework - A developer's perspective
Microsoft teams & bot framework - A developer's perspectiveMicrosoft teams & bot framework - A developer's perspective
Microsoft teams & bot framework - A developer's perspectiveThomas Gölles
 
Wiring the Web
Wiring the WebWiring the Web
Wiring the Webgoodfriday
 
Online bus pass registration
Online bus pass registrationOnline bus pass registration
Online bus pass registrationYesu Raj
 
Virtual Hub - Host SharePoint Framework web part as MS Teams messaging extension
Virtual Hub - Host SharePoint Framework web part as MS Teams messaging extensionVirtual Hub - Host SharePoint Framework web part as MS Teams messaging extension
Virtual Hub - Host SharePoint Framework web part as MS Teams messaging extensionNanddeep Nachan
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology StackHusain Ali
 
How to build and deploy app on Replit
How to build and deploy app on ReplitHow to build and deploy app on Replit
How to build and deploy app on Replitmatiasfund
 
Intégrez vos applications métiers dans Microsoft Teams
Intégrez vos applications métiers dans Microsoft TeamsIntégrez vos applications métiers dans Microsoft Teams
Intégrez vos applications métiers dans Microsoft TeamsGuillaume Meyer
 
Technology for Teachers
Technology for TeachersTechnology for Teachers
Technology for Teachersedfactor
 

Similar to Facebook Messenger Platform Framework (20)

Facebook thrift
Facebook thriftFacebook thrift
Facebook thrift
 
facebookthrift-151001153400-lva1-app6891.pptx
facebookthrift-151001153400-lva1-app6891.pptxfacebookthrift-151001153400-lva1-app6891.pptx
facebookthrift-151001153400-lva1-app6891.pptx
 
Automatic answer checker
Automatic answer checkerAutomatic answer checker
Automatic answer checker
 
Online advertising management system
Online advertising management systemOnline advertising management system
Online advertising management system
 
Online advertising management system
Online advertising management systemOnline advertising management system
Online advertising management system
 
Final Project In Instant messaging app that also brings you the intel...
Final Project In Instant  messaging  app  that   also  brings  you  the intel...Final Project In Instant  messaging  app  that   also  brings  you  the intel...
Final Project In Instant messaging app that also brings you the intel...
 
How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...
 How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi... How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...
How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...
 
An end-to-end experience of Windows Phone 7 development (Part 2)
An end-to-end experience of Windows Phone 7 development (Part 2)An end-to-end experience of Windows Phone 7 development (Part 2)
An end-to-end experience of Windows Phone 7 development (Part 2)
 
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
 
Microsoft teams & bot framework - A developer's perspective
Microsoft teams & bot framework - A developer's perspectiveMicrosoft teams & bot framework - A developer's perspective
Microsoft teams & bot framework - A developer's perspective
 
Wiring the Web
Wiring the WebWiring the Web
Wiring the Web
 
Online bus pass registration
Online bus pass registrationOnline bus pass registration
Online bus pass registration
 
Wechat Bible for Brands v1
Wechat Bible for Brands v1Wechat Bible for Brands v1
Wechat Bible for Brands v1
 
Virtual Hub - Host SharePoint Framework web part as MS Teams messaging extension
Virtual Hub - Host SharePoint Framework web part as MS Teams messaging extensionVirtual Hub - Host SharePoint Framework web part as MS Teams messaging extension
Virtual Hub - Host SharePoint Framework web part as MS Teams messaging extension
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology Stack
 
A Complete Guide to Python Web Development
A Complete Guide to Python Web DevelopmentA Complete Guide to Python Web Development
A Complete Guide to Python Web Development
 
How to build and deploy app on Replit
How to build and deploy app on ReplitHow to build and deploy app on Replit
How to build and deploy app on Replit
 
Intégrez vos applications métiers dans Microsoft Teams
Intégrez vos applications métiers dans Microsoft TeamsIntégrez vos applications métiers dans Microsoft Teams
Intégrez vos applications métiers dans Microsoft Teams
 
mobicon_paper
mobicon_papermobicon_paper
mobicon_paper
 
Technology for Teachers
Technology for TeachersTechnology for Teachers
Technology for Teachers
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Facebook Messenger Platform Framework

  • 1. Ram Murat Sharma, @rammrms rammurat.rms.sharma0@gmail.com
  • 2. Agenda  Introduction  Bots  Facebook bots  Prerequisite  Demo  CNN  Installations  Facebook page  Ngrok (Secure tunnels to localhost)  Node server  Facebook presentation layer (Structured Messages)  Facebook templates  Do we need a framework  Framework design  Framework application flow  File structure  WIT API  Firebase database  Future of bots  Framework source code
  • 3. Introduction to chat bots  Bots are simple artificial intelligence systems that you interact with via text. Those interactions can be straight forward, like asking a bot to give you a weather report, or more complex, like having one troubleshoot a problem with your internet service.  Short for chat robot, a computer program that simulates human conversation, or chat, through artificial intelligence.  Chat bots are used in applications such as ecommerce customer service, call centers and Internet gaming. Chat bots used for these purposes are typically limited to conversations regarding a specialized purpose and not for the entire range of human communication.
  • 4. Introduction to FB Bots  The Messenger Platform gives you the ability to have conversations with people on Messenger. We've added new tools for you to build and promote your bot so you can create a custom experience for your unique audience.  Why Facebook bot?  Web plugins - Using plugins, codes and links people can discover your bot and start conversations.  Customer Matching - Customer matching allows you to reach people in Messenger if you have their phone number and their consent to be contacted by you.  Structured Templates - You can format your messages in a variety of ways. Send simple text and images, or use our structured templates to customize your message bubbles.  User Controls - Provides people with even more ways to control the conversation and make sure they can reach the businesses they care about.
  • 5. Prerequisite  Good JavaScript knowledge  Ngrok installed(Secure tunnels to localhost)  Facebook page  Node server running  WIT account (NLP)  Firebase account (Google database)  Browser
  • 6. Demo (CNN - https://www.facebook.com/cnn/) CNN was among the first publishers to launch a bot in April, which is available to its global audience. CNN currently has a Facebook audience of 22 ML people, and CNN International has 12 ML. You can ask for news as per your interest by writing, for ex: “Latest on Donald Trump”
  • 8. Installation : Facebook page  Go to your app dashboard page - https://developers.facebook.com/apps/  Create new app by clicking messenger tab  Generate your access token  Subscribe your page for webhook  Create your callback url after installing ngrok and set your token in config file  Update your webhook details as shown below under webhook tab on Facebook page You must need a Facebook page to start with, which provides you complete features including a button to start your chat.
  • 9. Installation : Ngrok You also need to setup a secure tunnel to your localhost server. Ngrok is a tool that allows you to easily expose your localhost server to the outside world. Make sure your firewall won’t block this.  Download ngrok - https://ngrok.com/  Open command prompt and run “ngrok http 80”  Copy randomly generated domain name to link with Facebook webhook, here it is “https://9d71cd26.ngrok.io”
  • 10. Installation : Node server You also need to setup a node server on your localhost, which is responsible to handle and respond all the client/user requests. This server will act as a webhook or callback handler to Facebook API.  Download nodejs - https://nodejs.org/en/  Download framework from github  Go to synced folder  Open command prompt and run “npm install”  “/webhook/” with post request is implemented to handle all the request.
  • 12. Facebook Presentation layer Template types  Text message  Audio message  Video message  Option List  Carousel  Quick replies  Persistent Menu  Airlines templates Facebook messenger platform provides presentation layer, which has all the required templates. You don’t need to write any HTML or CSS for this. Structured Messages :- Structured messages support multiple templates to enable different kinds of use cases. The button and generic template can render buttons that open a URL or make a back-end call to your webhook. And the receipt template can be used to send the receipt.
  • 13. Facebook Presentation layer These templates contains Normal text, Option list, Quick replies and share location.
  • 14. Facebook Presentation layer These templates contains Order receipt, Dialog popup and Airlines design.
  • 15. Do we need a Framework? Imagine, you need to develop couple of chatbots which will help you to book movie tickets, order food like pizza or burger and book your table in some restaurant. Problem : You need to setup server, client, configuration file, define templates, structure your code, integrate your chatbots with NPL processors/engines and store chat history somewhere to cloud server. Solution : This framework provides pre-designed Facebook templates, built-in integration of system with WIT (NPL engine) and cloud database (Google Firebase) with your application. All you need is to put your questions in some JSON file, and load it in JavaScript object and run your application. You can further map your questions with WIT API as per your application flow. The framework will automatically save the chat history on cloud server i.e. firebase.
  • 16. Facebook Templates  Text message template In this template all you need is “message” that you want to send and a 16 digit user’s Facebook id like “1100223344556677” to identify the user  Option list template The list template is a template that allows you to present a set of items vertically. It can be rendered in two different ways. One list comes with action buttons, for ex:- Add to cart, Buy now etc. while the other one comes with normal list, with or without a product image  Carousel list template  Carousel list template is generic template and follows almost the same structure of option list, but it displays it’s data in carousel instead.  Receipt template  Receipt templates are used to send order confirmation to the API, with the transaction summary and description for each item.
  • 17. Facebook Templates Option List Template Receipt Template
  • 18. Framework Design  Presentation layer Presentation layer is provided by Facebook only, no need to create any html or style.  Application Layer Application layer plays the role of webhook handler, means it handles all the postback reply and direct text messages of user.  WIT layer WIT layer or API is used to process human natural language  Service Layer Service layer is responsible to send messages to the user, process user request and apply specified template as per requirement.  Data Layer Data can be drive either from any static JSON file or firebase, both methods are available with the framework.
  • 20.
  • 21. Framework files description  Configuration file This file is created to store all the configuration of framework including Facebook access token, WIT API token, firebase option settings, server details like port, IP address and application flow mapping.  Chat response handler This handler is the main handler which handles all the requests from Facebook including post- back and direct text request. This handler also manages what could be the next question to ask.  Template manager Template manager contains all the pure functions and return templates as per Facebook guidelines.  Service handler This handler is responsible to save user conversation, send messages, and map Facebook templates.  Data origin/load Data can be provided to system either from static JSON file or any database like firebase. This framework has an option to ingrate anyone of the these option.  User class handler User class is created to store user information and his/her activities after he/she start the chat session.
  • 22. Utterance (WIT.AI)  Wit.ai makes it easy for developers to build applications and devices that you can talk or text to. Wit.ai learns human language from every interaction. They have recently extends their previous intent-oriented approach to story oriented approach.  In Wit.ai we can use Entities, Intents, Context and Actions concepts that together form the model based on Machine Learning, and statistics can be used for understanding the language.
  • 23. Database(Google Firebase) Firebase is a mobile platform that helps you quickly develop high-quality apps, grow your user base, and earn more money. Firebase is made up of complementary features that you can mix- and-match to fit your needs. The company was acquired by Google in October 2014, and added a significant number of new features in by May 2016. Firebase can be the fastest and one of the recommended option for chatbot applications, whenever you want to save your chat history.
  • 24. Framework Source Code For more information or quick documentation and source code, you can check out the below link on GitHub. https://github.com/rammurat/facebook-bot-framework