Facebook Chatbot — book an appointment

Classmethod Canada
4 min readJul 4, 2019

--

Imagine if we can book appointments with your dentist / doctor using a chatbot.

Implementing a chatbot to interact with patients/clients, can help to improve customer experience with the business and reduce the amount of human interaction to book an appointments. Clinics and organizations would have more time to offer in person help to patients and customer and helps administrators to manage their tasks more efficiently.

We have created a demo page with embedded facebook messenger chatbot using Amazon Lex and other AWS services.

Say “Hi” (AWS Lex utterance) to our bot here https://demo.classmethod.ca/fbchatcss.htm

In this post, I will briefly go through the setup of the facebook messenger chatbot.

In this post, I will briefly go through the setup of the facebook messenger chatbot.

Architecture

Lambda function

Using the Amazon Lex blueprint, lex-make-appointment-python, we can schedule appointment to meet with Classmethod Canada staffs using Facebook Messenger. Our Facebook Messenger has implemented Lex chatbot that can provide general information about our company and our services using utterance that utilized natural language understanding (NLU) technology.

We use the blueprint to create an appointment and upload the appointment information to dynamoDB table with the addition of function updateDB().

Attached policy to the role associated to the Bot

Execute Test Event

Test result

Webpage hosting

The demo page https://demo.classmethod.ca/fbchatcss.html hosted on AWS S3 with css template from w3.css.

In order to enable HTTPS connection, we use AWS CloudFront content delivery services with a SSL certificate generate from Certificate Manager.

Embed Facebook messager

To embed facebook messenger into webpage, you need to get the code from facebook messenger.

Go to the facebook page Settings and add your domain to the Whitelisted Domains and setup Chat Plugin.

At the end of the Customer Chat Plugin setup you will have a code snippet to add the Facebook JaveScript SDK on the website.

Embed this Javascript into the HTML file to enable facebook messenger chatbot in the website.

Sample Use Cases

The appointment booking chatbot can be used for any type of appointment booking services. For example, dental and medical clinic or spa can embed a facebook chatbot into their website to increase customer service experience. Appointment tracking system can be linked to an external calendar API (ie. Google Calendar).

How to book an appointment

  1. Login Facebook account
  2. Type “book an appointment” in facebook messenger (Alternatively, type “Menu” and click “Appointment Demo”)
  3. Select Appointment Type (defined slots & update Lambda function)
  4. Prompt appointment time (M-F available, Weekend office close), user may enter response in 3 ways: (1) Type utterance such as: today, tomorrow, next Wednesday, next Wed, etc. (2) Click on the options on response card button. (3) Only 1 time slot is available
  5. Select time (randomly generated by function defined in lex blueprint)
  6. Confirm appointment
  7. Update appointment detail in DB

Try it on the Classmethod Canada facebook page!

--

--

Classmethod Canada
Classmethod Canada

Written by Classmethod Canada

We are Vancouver-based cloud integrators and solutions architects focusing on cloud system infrastructure, IoT cloud architecture and cloud migration .

No responses yet