integration

How To Build a GPT3 AI Chat Bot on WhatsApp

Step by step guide on how to launch an AI chat bot on WhatsApp. It's straightforward - no coding required!

How To Build a GPT3 AI Chat Bot on WhatsApp

Image has been generated with Stable Diffusion 2.1 using the following prompt: Futuristic robot announcing WhatsApp integration, beautiful colourful artistic photograph

In this guide, we’re going to follow 5 simple steps to create a smart conversational AI that anyone can talk to via WhatsApp:

  1. Verify your business with Facebook
  2. Create your WhatsApp bot app
  3. Configure your WhatsApp bot app
  4. Generate a WhatsApp access token
  5. Create a Quickchat.ai account
  6. Integrate your WhatsApp bot app with Quickchat.ai

1. Verify your business with Facebook

In order to connect your WhatsApp to an AI chat bot via Quickchat, your business needs to be verified on Facebook. Detailed instructions on how to do that are available on Facebook’s Business Help Center page. You will be required to provide additional information about your business and wait for the verification to be completed.

2. Create your WhatsApp bot app

While you’re waiting for your Business to be verified, you can already go ahead and look into creating a WhatsApp app to serve your AI chat bot.

Head over to developers.facebook.com/apps, click on Create App and follow the steps.

Select None as app type

Select None as app type

Provide app name, contact email address and select your Business Account

Provide app name, contact email address and select your Business Account

3. Configure your WhatsApp bot app

First of all, add WhatsApp and Webhooks products:

Add Messenger and Webhooks products

Add Messenger and Webhooks products

Once added, they will appear on the left-hand side:

Added products appear on the left-hand side

Added products appear on the left-hand side

Select your business phone number in WhatsApp Quickstart settings. That’s the number through which your users will be contacting your AI on WhatsApp. If you don’t know how to add a phone number to WhatsApp, you can follow this official tutorial.

Also, take a note of the Account ID. You will later need to paste it into the Quickchat dashboard.

Add the Facebook Page where your AI will be implemented

Add the Facebook Page where your AI will be implemented

As a next step, go to your app’s basic settings and set your Privacy policy URL, Contact email and Category. Once you’ve done that, set your app to live at the top.

Set Privacy policy URL, Contact email and Category, and set your app live.

Set Privacy policy URL, Contact email and Category, and set your app live.

While on this page, also take note of your App secret which you will also need to paste into the Quickchat dashboard.

Take note of your App secret.

Take note of your App secret.

4. Generate a WhatsApp access token

To generate an access token required to integrate with WhatsApp you will need to go to business.facebook.com/settings/system-users. Make sure you are looking at the correct business account.

First, you need to create a user with admin permissions. Keep in mind that there can be only one admin account.

Create an admin user for your Facebook business account.

Create an admin user for your Facebook business account.

Once the admin user is created, select Add assets under the Assigned Assets section.

Select Add Assets to assigne additional functionality to your app.

Select Add Assets to assigne additional functionality to your app.

Select Apps, choose your app with WhatsApp integration and give it full controll to Manage App.

Turn on Manage App setting for your asset.

Turn on Manage App setting for your asset.

Next, you will need to generate a new token. Press the Generate new token button and select your app. In the Available Permissions section select two permissions: whatsapp_business_messaging and whatsapp_business_management.

Add two WhatsApp-related permissions to your token.

Add two WhatsApp-related permissions to your token.

Finally, copy the generated access token and paste it into the Quickchat dashboard under the WhatsApp window in Integrations section.

5. Create a Quickchat AI account

Quickchat AI allows you to create your own AI Assistant that has great conversational skills and general world knowledge by default, out of the box.

If you want to, you can give your AI specific knowledge about your company, project, product or virtually anything else. If you want to learn how to do it, watch our 10-minute video guide on YouTube.

But even without any specific knowledge the Quickchat engine makes a great conversation partner so we’re going to go with that for now. Head over to quickchat.ai and create your account:

Start building

Start building

Subscribe for the 2-week trial for just $14.

Subscribe and pay with Stripe

Subscribe and pay with Stripe

6. Integrate your WhatsApp bot app with Quickchat AI

In the Integrations section of the Quickchat dashboard, paste your WhatsApp Account ID, App secret and Access token you found in previous steps.

Paste your WhatsApp Account ID, App secret and Access token

Paste your WhatsApp Account ID, App secret and Access token

The final step will be to integrate and verify the Quickchat webhook endpoint which will receive your message events. Go back to developers.facebook.com/apps, select your app and open your app’s WhatsApp Quickstart settings. Click on the Edit button for webhooks.

Edit callback URL

Edit callback URL

Set the correct callback URL as shown below while your Verify token can be found in the Quickchat dashboard as shown above.

Provide callback URL and Verify token, and Verify and safe

Provide callback URL and Verify token, and Verify and safe

Once the Callback URL has been correctly added, click on the Manage webhook fields button.

Manage your webhook fields

Manage your webhook fields

Subscribe to the messages fields and select Done to continue.

Subscribe to Messages field

Subscribe to Messages field

Once correctly configured and saved, your Webhooks sections is going to look something like this:

Correctly configured Webhooks section

Correctly configured Webhooks section

And that’s it! 🎉 Your AI chat bot is ready to be tested on WhatsApp:

End goal - smart conversational AI that anyone can talk to on WhatsApp

End goal - smart conversational AI that anyone can talk to on WhatsApp

Share this article:

comments powered by Disqus