messenger
19636
How to set up the WhatsApp Cloud API with BotSailor

BotSailor is a complete WhatsApp marketing automation; it has chatbot, live chat, broadcasting, Shopify & WooCommerce integration for order message automation, a webhook workflow, a WhatsApp catalog and many more. To use all these features from BotSailor, you must have your WhatsApp cloud API account set up first. It’s easy to setup and integrate WhatsApp cloud API to BotSailor. In this article, we are going to provide a detailed step-by-step procedure to create a WhatsApp cloud API.

Before beginning the process of creating the WhatsApp Cloud API, ensure that you have a phone number not currently associated with WhatsApp. If the number is already linked to a WhatsApp account or business account on any mobile app, it can still be utilized by migrating to the WhatsApp Cloud API. To migrate your existing WhatsApp account, you must first remove it from the mobile app and then add the number to your new WhatsApp Cloud API.

To understand the process of migrating your current WhatsApp number to the WhatsApp Cloud API, please refer to the blog linked below.

Migrate existing WhatsApp number to WhatsApp Cloud API

Steps to Connect WhatsApp Cloud API to BotSailor (Manual Process):

Create an App:

  • Go to the Facebook Developer site.
  • Click "My Apps" > "Create App".
  • Select "Business" as the app type.
  • Fill out the form with the necessary information and create the app.

Add WhatsApp to Your App:

  • On the product page, find the WhatsApp section and click "Setup".
  • Add a payment method if necessary, and navigate to "API Setup".

Get a Permanent Access Token:

  • Go to "Business Settings" on the Facebook Business site.
  • Create a system user and assign the necessary permissions.
  • Generate an access token with permissions for Business management, Catalog management, WhatsApp business messaging, and WhatsApp business management.

Configure Webhooks:

  • In the WhatsApp section of your app, click "Configure webhooks".
  • Get the Callback URL and Verify Token from BotSailor's dashboard under "Connect WhatsApp".
  • Paste these into the respective fields in the Facebook Developer console.

Add a Phone Number:

  • Provide and verify your business phone number in the WhatsApp section.

Change App Mode to Live:

  • Go to Basic Settings, add Privacy Policy and Terms of Service URLs, then toggle the app mode to live.

Connect to BotSailor:

  • On BotSailor, go to "Connect WhatsApp" in the dashboard.
  • Enter your WhatsApp Business Account ID and the access token.
  • Click "Connect".

By following these steps, you can easily set up and integrate the WhatsApp Cloud API with BotSailor. For a detailed guide, refer to ourYouTube tutorial

Prefer a Simpler Setup? Try BotSailor's Embed Signup (Few Clicks) (Recommended)

If you prefer not to go through the manual app creation process, BotSailor offers aone-click Embed Signup methodto streamline your onboarding. It’s the easiest and fastest way to connect your WhatsApp Business account to BotSailor—no app creation or token setup required.

👉Learn how to use Embed Signup to connect your WhatsApp Business Account

For Detailed instructions please follow the steps below For Manual Setup:

Create an App

So, before we can use BotSailor for WhatsApp chatbot marketing, we need to create the WhatsApp Cloud API and add a phone number to it. Then, we can connect the WhatsApp bot account (Cloud API) to BotSailor.

The first step in creating the WhatsApp Cloud API is to initially create an app from the Facebook developer account.To create an app, go todeveloper facebook. And click on the My Apps tab on the page.

Image

Instantly, a page will appear with a Create App button and all your predefined apps.

Click on theCreate Appbutton to create an app.

Image

On the next page, select "other"and click on thenextbutton.

Image

Instantly, a page will appear with a list of app types. And from the list of app types, you have to select a type. SelectBusinessas your app type. Then click on thenextbutton.

Image

And a form will appear, and you have to fill out the form by providing the basic information.

In theApp Namefield, put an app name for your app. In theApp Contact Emailfield, provide an Email address.

In theBusiness Accountfield, select a business account. Click on the field, and a list of predefined Business accounts will appear. From the list, you can select a business account. However, the field is optional. Later, when we add WhatsApp to this app, Meta will ask to add a business account. If you don't have one, you can create it later and add it there.

Now click on theCreate Appbutton.

Image

Instantly, a pop-up form will appear with a password field. And in the password field, you have to re-enter your Facebook password. After re-entering your Facebook password, click on the submit button.

Instantly, theproduct pagewill appear. On the page, you have to add a product to the app.

Since you will create an app for a WhatsApp business account, you have to addWhatsAppto the app.

Scroll down the page, and you will see theWhatsApp section. Now click on thesetupbutton in the WhatsApp section.

Image

Instantly, theQuickstartpage will appear. Here, you will see the options to add a payment method. Unless you add the payment method, you won't be able to send Business-Initiated Messages (Message Templates) to your subscribers. You can add the payment method later. After adding thePayment methodclick on theAPI Setupfrom the left navigation menu.

Image

From the API setup, there is a temporary access token field, You will get a temporary access token that will expire in 23 hours. You would better not use the temporary access token.(We do not recommend using the Temporary access token.)

Image

You can also refresh the token by clicking on the refresh button. If you connect the bot with the access token, the bot will last only 23 hours. You can use the temporary access token for testing purposes. I suggest you not to use a temporary access token. Also, there is a test phone number that can be used on BotSailor to test the WhatsApp cloud API.

In the phone number section, you will see the phone number ID and WhatsApp business account ID. And to connect to the bot, you need the WhatsApp Business Account ID.(We don't recommend using the Test number.)

Image

Add a phone number (Your business number)

Now you have to add a phone number for the bot and verify it. To add and verify a phone number, go to the step-5 section calledAdd a phone number.

Now go to step 5 and click on theAdd phone numberbutton. If you already have a WhatsApp account with the number that you want to add here, you need to remove the number from your existing WhatsApp account. To learn how to remove the phone number from your existing WhatsApp account, please read the blog below.

Read this blog to use your existing WhatsApp number to the WhatsApp cloud API.

Migrate existing WhatsApp number to WhatsApp Cloud API

Image

And instantly, a modal form will appear. In the form, you must provide profile information that will be visible to people on WhatsApp.

In theWhatsApp Business display name, you have to provide a display name. The display name should be the same as your business name or similar to it; otherwise, WhatsApp may not approve the display name for your WhatsApp Cloud API. Then, in theTimezone field, select your timezone. Then select acategoryof your business in the Category field. Click on the Category field and a drop-down list of the different categories will appear. And from the list, select your prefered category.

Then you can write yourbusiness description.This field is optional, not required. Then click on thenextbutton.

Image

Instantly, a modal form will appear with a field called thephone number. And in the Phone Number field, you have to provide your phone number. After that, you have to choose how you would like to verify your phone number — via text message or Phone call.

Image

Well, after providing your phone number and choosing the verifying option click on the next button.

Then, you have to verify your phone number.

Image

Configure Webhook

Now, you have to configure the webhook to receive messages. To configure webhooks, go tostep 3 and click on the Configure webhooks button.

Image

Instantly, a page called Configuration will appear.

In the webhook section, you will see an edit button. Now click on the edit button.

Image

Instantly, a pop-up form will appear with two fields: — Callback URL and Verify Token. Now you have to provide a callback URL and verify the token.

Image

To get the Callback URL and Verify Token go to BotSailor.com. Login to your BotSailor account and go to the dashboard. At the left sidebar of the Dashboard, under the WhatsApp section, you will seeConnect WhatsAppoption. Now click on the Connect WhatsApp menu and instantly, the Connect WhatsApp Business page will appear.

At the top of the page, you will see the Webhook Callback URL and verify token. Copy them and return to the Configuration page of developer facebook.

Image

Then paste the Webhook Callback URL and verify token in the callback URL and verify token fields respectively. Now click on the verify and save button.

Image

Now you have to select webhook fields. To select webhook fields, click on theManagebutton.

Image

Instantly, a pop-up modal will appear with some webhook fields. Now subscribe toMessageswebhook field. Now click on the Done button.

Image

You can also subscribe and unsubscribe to webhooks on the webhooks page. Click on the webhooks menu and the webhook page will appear with some webhook fields. On the page, you can subscribe to and unsubscribe from any webhook field.

Image

Change the App modefrom Developmentto Live

Now, you need to change the app mode fromdevelopment to live. To do that, simply click on thetogglebutton at the top of the page.

Image

As soon as we click on the toggle button to change the mode, it will ask to provide a validPrivacy policy URL. Click on the Basic Settingsfrom there.

Image

Copy theprivacy policy URL and Terms of Service URLfrom the Botsailor's Connect account page and paste them into the respective fields. Then, click on the save button.

Image

Image

After saving, click on thetoggle button again, and it will become live.

Image

Return to the API Setup and collect token to connect the Bot to the BotSailor

Now return to the API Setup page by clicking on theAPI Setupmenu on the left sidebar of the page.


Image

Collect Access Token

Now you have to collect a permanent access token to connect your bot.

In the step 5 section, click on the see the overview page link.

Image

Instantly, you will be redirected to the overview page of the business Facebook site.

On the overview page, click on the menu button, and the left sidebar will be expanded with all the tools. Now click on theBusiness Settings.

Image

And you will be redirected to the Business settings page.

Now you have to create auser. To create a user, first, you have to selectSystem userin the left sidebar of the business settings page. Now you have to add users by clicking on the add button.

Just as you click on theAdd userbutton, a pop-up form will appear with thesystem user name and role field.

In the system user name field, give a user name, and in the system user role field, select a role— employee or admin.

If you want to add a user as an employee, select employee. On the other hand, if you want to add a user as an admin, select admin.(We recommend using Admin.)

Then click on thecreate system userbutton. And it will create the user.

Image

After you have created a user, the user will be available in the list of users.

Now you have to add assets for a user. To add assets for a user,select a user and click on the Add Assets button.

Image

Instantly, a modal will appear. From the Select asset type section of the modal, select theAppsmenu. Now select the app to which you want to assign assets. Then give permission. here, I permit Full control by enabling the radio button of theFull controloption. Now click on theSave Changesbutton.

Image

Now you have to generate an access token. To generate an access token for the user click on the Generate new token button.

Image

Instantly, a modal form will appear with a field called select app. Now click on the select app field, and the drop-down list of your apps will appear.From here select the App.

Image

Then a token expiry limit and a list of available permissions will appear. We recommend to select the never for token expiry. From the permission list, you have to selectBusiness management, Catalog management, WhatsApp business messaging, and WhatsApp business management.After that click on theGenerate tokenbutton.

Image

Instantly, a modal will appear with an access token. Now copy and save the access token.

Image

Now go to the dashboard of BotSailor.com. In the WhatsApp section of the left sidebar, click on theConnect WhatsAppmenu. Instantly connect WhatsApp page will appear.

Now you have to enter theWhatsApp business account ID and access token.

To get theWhatsApp Business Account ID, go to the Business Settings page. Then, in the left sidebar of the page, select the WhatsApp account menu. Instantly, the WhatsApp Accounts section will appear. Now select your app and copy the WhatsApp Business Account ID.

Image

After entering the WhatsApp business account id and access token, click on the Connect button.

Image

And you will see a successful message, and the account will be visible on the Connect page.

Image

If your read to this article mindfully and follow the instructions step by step, you can easily connect the WhatsApp bot to BotSailor.

You can also watch our video tutorial on YouTube titled "How to Setup WhatsApp Cloud API to Create WhatsApp Chatbot":


author

Kamrul Hasan

22 Aug 2022
  • Categories :

  • How to

(2) Comments

Related Articles

Stay ahead of the curve with BotSailor`s latest articles. Dive into expert analyses, industry trends, and actionable tips to optimize your experience. Explore our articles now and unlock the full potential of your business.

Train AI Assistant for Chatbot With FAQ, URL & File

Train AI Assistant for Chatbot With FAQ, URL & File

Train AI Assistant for Chatbot With FAQ, URL & FileBotSailor's just launched its AI Assistant chatbot feature giving...

READ MORE
Launch Your SaaS with BotSailor White Label Chatbot Marketing

Launch Your SaaS with BotSailor White Label Chatbot Marketing

Unlock a Profitable Business with BotSailor's White Label Reseller Program Are you looking for an effortless way to ...

READ MORE
BotSailor’s Affiliate Program

BotSailor’s Affiliate Program

We're delighted to announce the opening of the BotSailor Affiliate Program today! We developed it as a way to thank the ...

READ MORE