volver a tutoriales

How to create WhatsApp AI Bot

Learn how to integrate your ChatBotKit with WhatsApp in this detailed guide, covering setup, configuration, and advanced features for a seamless conversational experience.

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.

  1. Go to ChatBotKit and create a new WhatsApp Integration.

  2. Type integration name and optional description and press the "Create" button.

  3. Save the "Callback Endpoint" and "Verify Token" for later.

  4. Go to Meta Developer Portal and create a new application.

  5. Select "Other" from the "What do you want your app to do?" screen.

  6. Select "Business" type app from the list of available options.

  7. Name your app, type in your email and select your business account. Click the "Create app" button.

  8. Click the "Setup" button for the WhatsApp Product.

  9. Click the "Webhooks" block form the "Quickstart" screen.

  10. Click the "Edit" button to setup a webhook.

  11. Copy the "Callback Endpoint" and "Verify Token" we saved in step 3 and click on the "Verify and save" button.

  12. Click the "Manage" button.

  13. Select only the "messages" field. Click the "Done" button.

  14. 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.

  15. Paste the "Phone Number ID" in ChatBotKit and click the "Save" button.

  16. Go to your Meta Business to create a new user if you do not have one already.

  17. Select "System Users" and click on the "Add" button.

  18. Make sure the "System User Role" is set to "Admin".

  19. Click on the "Add Assets" button.

  20. Select the "Apps" type. Select your application from the "Selected assets" list. Finally make sure you select the "Manage app" option under "Full control".

  21. Finally, we need generate a token. Click the "Generate New Token" button.

  22. 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.

  23. Now copy the "Access Token".

  24. 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.