How to set up the WhatsApp Cloud API with BotSailor

blog

22 Aug 2022

10884

Meta has now opened the WhatsApp cloud API worldwide for the WhatsApp Messaging platform. With this official WhatsApp API, which is secure and safe to use, chatbot marketing on WhatsApp becomes accessible. After creating the WhatsApp Cloud API and connecting it to BotSailor, you can create chatbots and send WhatsApp broadcasting messages to subscribers. Additionally, broadcasting to any imported contacts on WhatsApp is possible.

 

 

 

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 to be 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 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.

 

https://botsailor.com/blog/how-to-migrate-your-existing-whatsapp-account-to-whatsapp-cloud-api

 

 

 

Follow the steps below to create the WhatsApp cloud API and integrate it BotSailor.

 

 

 

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 to  developer facebook . And click on the My Apps tab on the page. 

 

 

 

 

 

 

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

 

Click on the Create App button to create an app.

 

 

 

 

 

 

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

 

 

 

 

 

 

Instantly, a page will appear with a list of app types. And from the list of app types, you have to select a type. Select Business as your app type. Then click on the next button. 

 

 

 

 

 

 

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

 

In the App Name field, put an app name for your app. In the App Contact Email field, provide an Email address. 

 

In the Business Account field, 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 the Create App button.

 

 

 

 

 

 

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, the product page will 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 add WhatsApp to the app. 

 

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

 

 

 

 

 

 

Instantly, the Quickstart page 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 the Payment method click on the API Setup from the left navigation menu.

 

 

 

 

 

 

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

 

 

 

 

 

 

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

 

 

 

 

 

 

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 called Add a phone number.

 

Now go to step 5 and click on the Add phone number button. 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.

 

https://botsailor.com/blog/how-to-migrate-your-existing-whatsapp-account-to-whatsapp-cloud-api

 

 

 

 

 

 

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

 

In the WhatsApp 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 the Timezone field, select your timezone. Then select a category of 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 your business description. This field is optional, not required. Then click on the next button. 

 

 

 

 

 

 

Instantly, a modal form will appear with a field called the phone 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. 

 

 

 

 

 

 

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

 

Then, you have to verify your phone number. 

 

 

 

 

 

 

Configure Webhook

 

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

 

 

 

 

 

 

Instantly, a page called Configuration will appear. 

 

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

 

 

 

 

 

 

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. 

 

 

 

 

 

 

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 see Connect WhatsApp option. 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.

 

 

 

 

 

 

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. 

 

 

 

 

 

 

Now you have to select webhook fields. To select webhook fields, click on the Manage button. 

 

 

 

 

 

 

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

 

 

 

 

 

 

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.

 

 

 

 

 

 

Change the App mode from Development to Live

 

Now, you need to change the app mode from development to live. To do that, simply click on the toggle button at the top of the page.

 

 

 

 

 

 

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

 

 

 

 

 

 

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

 

 

 

 

 

 

 

 

 

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

 

 

 

 

 

 

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 the API Setup menu on the left sidebar of the page. 

 

 

 

 

 

 

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. 

 

 

 

 

 

 

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 the Business Settings.

 

 

 

 

 

 

And you will be redirected to the Business settings page. 

 

Now you have to create a user. To create a user, first, you have to select System user in 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 the Add user button, a pop-up form will appear with the system 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 the create system user button. And it will create the user. 

 

 

 

 

 

 

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. 

 

 

 

 

 

 

Instantly, a modal will appear. From the Select asset type section of the modal, select the Apps menu. 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 the Full control option. Now click on the Save Changes button. 

 

 

 

 

 

 

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

 

 

 

 

 

 

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. 

 

 

 

 

 

 

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 select Business management, Catalog management, WhatsApp business messaging, and WhatsApp business management. After that click on the Generate token button. 

 

 

 

 

 

 

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

 

 

 

 

 

 

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

 

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

 

To get the WhatsApp 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. 

 

 

 

 

 

 

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

 

 

 

 

 

 

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

 

 

 

 

 

 

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":

 

 

 

Share This Post
author
Written by

Kamrul Hasan

➢  more from this author

Comments (2)

  • author
    Nimrode
    1 year ago
    • author
      Kamrul Hasan 25 days ago