WhatsApp Integration
Documentation

MyBot Integration with WhatsApp

Follow this step-by-step guide to integrate WhatsApp with your chatbot. The goal of this integration is to let user chat with your bot via WhatsApp App.

Prerequisites

Ensure that you have the following requirements first to start this tutorial.

  1. MyBot account: You should have an existing MyBot account and a chatbot already created. If not, follow this tutorial to get started.
  2. Meta Developer account: You'll need a Meta (Facebook) Developer account to use WhatsApp Business API.
  3. Meta Business Portfolio You'll need a Meta Business Portfolio to create a Meta App

1. Create an App on Meta Developer Portal

If you already have a Meta App, you can skip this step.

  1. Click on Create App in the top right corner of the Meta Developer Portal. Select a business portfolio from the dropdown list. creating an app You should see this screen to click "Next" creating an app

  2. Choose Other on this next screen. creating an app

  3. Choose Business as the app type, since WhatsApp Business API requires this. creating an app

  4. Fill in the required information creating an app

  5. Click Create App to complete the app creation process. Then you shoud see the App dashboard

    creating an app

Once your app is created, it will be available for further configuration.

2. Register Your Phone Number

You need to register a phone number for WhatsApp Business if you do not have one yet. Otherwise skip this step.

  1. In your Meta Developer account, go to WhatsApp > Getting Started.
  2. Register your phone number by selecting Add Phone Number.
  3. Verify the phone number via SMS or a voice call.
  4. After verification, your phone number will be linked to the WhatsApp Business API.

3. Create WhatsApp Access Token for MyBotChat

This access token is used in MyBotChat to reply to user via WhatsApp API. Follow these steps to create a new Access Token.

  1. Go to business.facebook.com and select a business portfolio as in the screenshot below. business portfolio selection

  2. Under Users menu, select System Users and click "Add" on the top right button business portfolio selection

  3. In this Popup form, fill out the required information and click "Create System User" business portfolio selection

  4. Select the new user you just created to see the page that look like below and click on "Assign Assets" button business portfolio selection

  5. Select the App menu on this popup, then select your app and check "Full control" option before clicking "Assign assets' button to finish business portfolio selection

  6. Now you should see similar page as below and click on the button "Generate token" business portfolio selection

  7. On this popup, select your app, then set expiration to never and assign message permission as in screenshot below generate access token

    Select "Never" to not let this token expired anytime soon. generate access token

    Select permission from dropdown list and click "Generate token" button below generate access token

  8. At this last screen you need to copy the access token and save it for use later in MyBotChat setup page. generate access token

4. Setup MyBotChat

Assuming that you already created a bot and trained it.

  1. Go to "My Chatbots" and click "Integrations" tab to access the integration page. Webhook Setup Example
  2. Under "WhatsApp" integration box, click "Setup" Webhook Setup Example
  3. Past the Meta Access Token you got from previous step.
  4. Click on Save button to save this Access Token in MyBot.
  5. Copy the Verify Token for use in Meta App in the following step.
  6. Copy the Webhook URL for use in Meta App in the following step.

Example screenshot of Create Webhooks webhook setup:

Webhook Setup Example

5. Set Up Webhooks in Meta App

Continuing from previous section, configure the callback URL and verify token from your MyBot to connect WhatsApp with MyBot Chatbot.

  1. Past the Webhook URL you copy from the previous section into Callback URL input box.
  2. Past the Verify Token you copy from previous section into the input box.
  3. Scroll down the page to see the optiont subscribe for messages.

Example screenshot of webhook setup:

Webhook Setup Example Webhook Setup Example

6. Test the Integration

  1. Send a test message from WhatsApp to your registered phone number.
  2. In your WhatsApp account, you should now see this message received and processed by your chatbot.

Example screenshot of testing the integration:

Test Integration Example

An unhandled error has occurred. Reload 🗙