Connect Account
To build a WhatsApp bot, first, you have to connect your bot to WhatsChat. And to connect your bot, you have to create a WhatsApp Cloud API.
To create an app, go to https://developers.facebook.com/. And click on the My Apps tab on the page.
![](https://app.whatschat.io/assets/docs/images/connect_bot/my_apps.png)
Instantly, a page will appear with a Create App button and all your predefined apps.
![](https://app.whatschat.io/assets/docs/images/connect_bot/create_app.png)
Instantly, a page called Create an App 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.
![](https://app.whatschat.io/assets/docs/images/connect_bot/select_business.png)
And a form will appear and you have to fill out the form by providing the basic information.
In the Display name field, add a display name for your business account. In the App Contact Email field, provide an Email address.
In the Business Account field, you can select a Business account. Click on the Field, and a list of predefined Business accounts will appear. And from the list, you can select a Business account. Anyway, the field is optional at this stage.
Now click on the Create App button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/app_name.png)
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 of the WhatsApp section.
![](https://app.whatschat.io/assets/docs/images/connect_bot/add_product.png)
After clicking on the “Set up” button a page will appear for next steps. You can add a payment method here. But the payment method can be added later.
![](https://app.whatschat.io/assets/docs/images/connect_bot/add_payment_method.png)
Add phone number
Then go to API setup from the left menu and click on the “Add phone number” button to add the phone number for WhatsApp Cloud API.
![](https://app.whatschat.io/assets/docs/images/connect_bot/add_phone_number.png)
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 Profile display name, you have to provide a display name. Then in the Timezone field, select a 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 a category.
Then you can write your business description — the field is optional, not required. Then click on the next button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/create_business_profile.png)
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.
![](https://app.whatschat.io/assets/docs/images/connect_bot/enter_phone_number.png )
Well, after providing your phone number and choosing the verifying option click on the next button.
Then, you have to verify your phone number.
![](https://app.whatschat.io/assets/docs/images/connect_bot/verify_phone_number_with_code.png)
Configure Webhook
Now, you have to configure the webhook to receive messages. To configure webhooks, go to step 3 from the API setup and click on the Configure webhooks link.
![](https://app.whatschat.io/assets/docs/images/connect_bot/configure_webhook.png)
Instantly, a page called Configuration will appear.
In the webhook section, you will see an edit button. Now click on the edit button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/callback_url.png)
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.
![](https://app.whatschat.io/assets/docs/images/connect_bot/enter_callback_url.png)
To get the callback URL and verify the token from WhatsChat. Login to your account and go to the dashboard of WhatsChat. 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, Connect WhatsApp Business page will appear.
At the top of the page, you will see Webhook Callback URL and verify token. Copy them and return to the Configuration page of developer facebook.
![](https://app.whatschat.io/assets/docs/images/connect_bot/privacy_url.png)
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.
![](https://app.whatschat.io/assets/docs/images/connect_bot/save_callback_url.png)
Now you have to select webhook fields. To select webhook fields, click on the Manage button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/manage_webhook.png)
Instantly, a pop-up modal will appear with some webhook fields. Now subscribe Message webhook field. Now click on the Done button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/webhook_fields.png)
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 to any webhook field.
![](https://app.whatschat.io/assets/docs/images/connect_bot/webhook_unsubscribe.png)
Then from the App settings, click on the Basic option and add the Privacy Policy URL and Terms of Service URL from the WhatsChat. These URLs are available on the Connect bot page of WhatsChat. After adding these URLs just click on the “Save changes” button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/live_mode.png)
To get those URL’s go to Connect bot.
![](https://app.whatschat.io/assets/docs/images/connect_bot/privacy_url.png)
After adding the adding the privacy and terms and condition URLs, just enable the live mode from the developer mode. To do that just click on the toggle button as show below.
![](https://app.whatschat.io/assets/docs/images/connect_bot/live_mode.png)
Now return to the API Setup page by clicking on the API Setup menu on the left sidebar of the page.
![](https://app.whatschat.io/assets/docs/images/connect_bot/api_set_up.png)
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 button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/see_over_view.png)
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 tools. Now click on the Business Settings.
![](https://app.whatschat.io/assets/docs/images/connect_bot/business_setting.png)
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 setting page. Now you have to add user by clicking on the add button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/system_users.png)
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.
Then click on the create system user button. And it will create the user.
![](https://app.whatschat.io/assets/docs/images/connect_bot/create_system_user.png)
After you have created a user, the user will be available in the list of users.
![](https://app.whatschat.io/assets/docs/images/connect_bot/system_users_list.png)
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.
![](https://app.whatschat.io/assets/docs/images/connect_bot/add_asset_for_a_user.png)
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.
![](https://app.whatschat.io/assets/docs/images/connect_bot/assign_asset.png)
Now you have to generate an access token. To generate an access token for the user click on the Generate new token button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/generate_new_token.png)
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.
![](https://app.whatschat.io/assets/docs/images/connect_bot/select_an_app_to_generate_new_token.png)
Then a list of available permission will appear. From the list, you have to select Business management,Catalog management,WhatsApp business messaging, and WhatsApp business management. Now click on the Generate token button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/access_token.png)
Instantly, a modal will appear with an access token. Now copy and save the access token.
![](https://app.whatschat.io/assets/docs/images/connect_bot/access_token_generated.png)
Now go to the dashboard. 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 at 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.
![](https://app.whatschat.io/assets/docs/images/connect_bot/whatsapp_business_acount_id.png)
After entering the WhatsApp business account id and access token, click on the Connect button.
![](https://app.whatschat.io/assets/docs/images/connect_bot/provide_access.png)
And you will see a successful message.
![](https://app.whatschat.io/assets/docs/images/connect_bot/successfull_message.png)
If your read to article mindfully and follow the instructions step by step, you can easily connect the WhatsApp bot to WhatsChat easily.