search

Adding a chatbot to WhatsApp


Introducing WhatsApp integration

You can deploy the same chatbot, with the same knowledge base, on your website and on other channels, including WhatsApp.

This means you can automate the answering of frequently asked questions, wherever your customers are asking them. All your chat forms and escalations will work on WhatsApp too.

To set up your bot in WhatsApp, you'll first need to create an app on WhatsApp, and then connect it to your FAQ Bot.

This article describes the steps you need to take. 

Prerequisites

Before you get started, you will need:

  • A Meta for Developers account. If you don't have an account, you can create one at developers.facebook.com.
  • A WhatsApp Business Account
  • A Premium FAQ Bot subscription. WhatsApp bots are not available on Starter or Standard plans. See pricing.

Note that this information is correct at the time of writing, but the Meta app submission process is subject to change. If you need any help, please get in touch.

Bot features on WhatsApp

There are some differences in how FAQ Bot features work on WhatsApp, due to the limitations of that channel. 

Create an app

Users will access your bot from a WhatsApp link/number. To connect the bot, you'll first create an app and then connect the bot to the app.

Create your app

  1. Sign in to your Meta for Developers account.
  2. Go to Create App
  3. On the Create an app page, select Other and then Next

  4. On the Select an app type page select Business and click Next
  5. On the Details page, enter a name for your app and select Create app.
    • If prompted, enter your password and select Submit to create your app.
    • After your app is created, the site goes to a page for your app.
  6. You'll see a set of products. Click Set up on the WhatsApp tile


  7. You'll then be prompted to select your Meta Business Account.

Configure your app

Test details

Under WhatsApp on the side menu, click API Setup. There are a few things here you can use for testing:

  1. Temporary access token (note this token will expire after 23 hours, so is only suitable for initial testing. It will need to be refreshed or replaced with a system user access token)
  2. From phone number - including a number you can use for testing - this is the number of your app/bot
  3. To phone number - this is the phone number of the device you will be testing from. Once you enter this number, you will be sent a verification code, which you'll need to add here to confirm the connection.

Configuration

Under WhatsApp on the side menu, click Configuration.

  1. Enter the callback URL. This is in the format 
    https://bot.faqbot.nz/api/v1.0/webhook/{PAGE_OR_NUMBER_ID}/{FAQ_SUBSCRIPTION_KEY}/messages
    1. Find your {PAGE_OR_NUMBER_ID} on the API Setup page (see above) - you're looking for the Phone number ID
    2. Find your {FAQ_SUBSCRIPTION_KEY} on the Widget setup tab in the FAQ Bot Portal > Configuration > Main
    3. Enter "faq" in Verify token
    4. Click Verify and save
  2. Click Manage to manage Webhook fields. Select Messages and click Done

 

Create your System Users Access token

Follow the instructions on this page.

Assign the app you have created above as an asset.

Some things to note on your token:

  • Token expiration - when your token expires, your bot will stop working. So you may wish to set expiry to "Never" (recommended)
  • Permission required: whatsapp_business_messaging

Copy the token as you'll need it for the next step.

 

Connect your bot 

In the FAQ Bot portal, navigate to the Channel settings tab on Configuration > Main

In the WhatsApp section:

  1. Enter your Phone number ID
    Find this in your Meta for Developers Account under WhatsApp > API Setup

  2. Enter your Access token
    For a quick test, you can use your temporary access token. Find this in your Meta for Developers Account under WhatsApp > API Setup - note this will only last for a short time
    To set up a permanent token, follow this guide to set up a system user access token.

  3. Enter your App secret
    You'll find this in your Meta for Developers Account, under App settings > Basic

Once the steps above are complete, you will be ready to test your bot on WhatsApp.



Testing your bot in WhatsApp

WhatsApp users won't be able to message your bot until while it's in Development mode without first connecting a To phone number for testing. To connect a test device phone number (ie the mobile phone you will be testing on), go to API Setup under WhatsApp on the side menu. Once you enter this number, you will be sent a verification code, which you'll need to add on this screen to confirm the connection.

You can add and verify more than one number if you have multiple testers.

 

App review & publication

Until an app is published, it's in Development Mode. It will only work for admins, developers, and testers.

Once you have tested your bot on WhatsApp, there are some review steps that need to be completed to move your app from Development to Live mode and publish your app.

1. Toggle from Development to Live in your app dashboard. Any required steps will be highlighted, for example:

  • add privacy policy URL. This could be a link to your organisation's privacy policy, typically on your website. 

2. Go to App Review > Permissions and Features

3. Request Advanced Access to whatsapp_business_messaging. Business Verification is required, as well as App Review.

4. Complete the rest of the required information. You will need to:

  • Answer questions about data handling, eg -  

  • Check you have requested the necessary permissions and features (see above)
  • Select the audience for your app

  • Provide justification for your app - answer the specified questions and provide a screencast. Contact us for guidance.

 

The App Review process can take 10 days or more, and may require revisions depending on the individual app reviewers. 
 
 

WhatsApp documentation

For WhatsApp documentation for developers, see https://developers.facebook.com/docs/whatsapp/

 

 

 


Helpful?