How to create WhatsApp AI Bot
In this comprehensive guide, we'll walk you through the detailed process of integrating your ChatBotKit with WhatsApp. By following these steps, you will enable your AI bot to interact with users directly on WhatsApp, providing a seamless and robust conversational experience for your users. This integration will not only enhance user engagement but also streamline communication, making it more efficient and effective.
We will cover everything from initial setup and configuration to advanced features and troubleshooting tips. By the end of this guide, you will have a fully functional ChatBotKit integrated with WhatsApp, ready to deliver a top-notch conversational experience.
Let's get started!
Step-by-step Setup Guide
Before you proceed you will need Meta Business account. Depending on your business account status you may also need to setup payment details get a permanent or a test phone number which is required in subsequent steps.
-
Go to ChatBotKit and create a new WhatsApp Integration.
-
Type integration name and optional description and press the "Create" button.
-
Save the "Callback Endpoint" and "Verify Token" for later.
-
Go to Meta Developer Portal and create a new application.
-
Select "Other" from the "What do you want your app to do?" screen.
-
Select "Business" type app from the list of available options.
-
Name your app, type in your email and select your business account. Click the "Create app" button.
-
Click the "Setup" button for the WhatsApp Product.
-
Click the "Webhooks" block form the "Quickstart" screen.
-
Click the "Edit" button to setup a webhook.
-
Copy the "Callback Endpoint" and "Verify Token" we saved in step 3 and click on the "Verify and save" button.
-
Click the "Manage" button.
-
Select only the "messages" field. Click the "Done" button.
-
Go to "API Setup" and copy your "Phone number ID". You need to either buy or setup a test phone number if you do not have one already.
-
Paste the "Phone Number ID" in ChatBotKit and click the "Save" button.
-
Go to your Meta Business to create a new user if you do not have one already.
-
Select "System Users" and click on the "Add" button.
-
Make sure the "System User Role" is set to "Admin".
-
Click on the "Add Assets" button.
-
Select the "Apps" type. Select your application from the "Selected assets" list. Finally make sure you select the "Manage app" option under "Full control".
-
Finally, we need generate a token. Click the "Generate New Token" button.
-
Select your app from the dropdown list. Make sure you also select bot "whatsapp_business_messaging" and "whatsapp_business_management" options from the permissions list. Finally, click the "Generate Token" button.
-
Now copy the "Access Token".
-
Paste the token in your ChatBotKit integration and press the "Save" button.
Congratulations you have completed the 20 step setup guide!
Chatting with your WhatsApp bot
To start chatting with your WhatsApp bot you need to connect to one of your dedicated or test phone numbers. You can find this information in the API setup settings.
⚠️ WhatsApp Test Phone Numbers
If you are using a test number, make sure that you add your own phone number in the number list otherwise you wont be able to communicate with the test number. To do so navigate to WhatsApp "API Setup" page. Click on the "To" field. Then click on the "Manage phone number list". Add your number. This is an important step if you are using test numbers.
Simply add the number as a contact or type it into the WhatsApp chat search box.