How to setup a WhatsApp Bot in the Meta cloud from start to finish  

Step by Step Summary

  1. Get Business manager verified and setup a new app in the Developer portal
  2. Add WhatsApp as a product in your new app in Developers portal
  3. Setup a number in section 5 of “API Setup” in the developers portal
  4. Add configuration keys - Callback URL and Verify token in the Configuration section
  5. In the “Webhook fields” section directly below, press the “Manage” button and click ALL the tickboxes in “Subscribe” column
  6. Add payment method in Meta Business Manager
  7. Generate System User token
      1. In Business Manager, create an Asset with “Manage App” under Full control
      2. Generate token - Select “Never” for token expiration and tick the following boxes
        1.  Business Management
        2.  WhatsApp business messaging
        3.  WhatsApp Business management
      3. Copy token and send to Yazi
  8. Copy Phone number ID and WhatsApp Business Account ID in API setup in the developers Portal and send to Yazi
  9. Toggle Developer mode to be on Live

META FOR DEVELOPERS

1. Setup Developer Portal

1.1 Create an app

Go to Meta for Developers and click “Create App”  

  1. Select “Other” for “What do you want the app to do?”
  2. Select “Business” for “Select an app type”
  3. Give your app a name, add a contact email and associate it with a Meta Business Manager
Screenshot 2023-09-06 at 09.02.37.png
meta for developers
Screenshot 2023-09-06 at 09.02.58.png
Screenshot 2023-09-06 at 09.03.20.png

https://developers.facebook.com/apps/

Business Manager Verification in Meta Settings.

Now you will be eligible to verify your Facebook Business Manager. Verify your business Manager by uploading your company documents to prove that you are a legitimate company.

Meta article about this here: https://www.facebook.com/business/help/2058515294227817?id=180505742745347

Verification docs

These documents should validate the legal name of your business and your business’s official mailing address or phone number

Accepted document types

The primary document types that are acceptable for business verification are as follows. Make sure these documents are not expired and are issued by the relevant authorities.

  • Certificate/Articles of Incorporation
  • Business Registration or License Document
  • Government Issued Business Tax Document: This could include a Tax Certificate. Self-filed tax documents are not accepted.
  • Business Bank Statement
  • Utility Bill: A utility bill is accepted only for Business Address and Phone number. The Legal Business Name must be on the utility bill. A utility bill is not an acceptable document for Legal Business Name verification

https://business.facebook.com/settings/info?business_id=

Screenshot 2023-09-06 at 09.04.14.png

1.2 Create WhatsApp product

  1. Click “Add Product”
  2. Scroll down to WhatsApp and click “Set Up”
  3. Press “Continue” in Quick start
Screenshot 2023-11-01 at 08.57.04.png
Screenshot 2023-11-01 at 08.43.03.png

2. API Setup

2.1 Add phone number

  1. Click on “Add phone number” button in “Step 5: Add a phone number section”. Fill out your profile name and add the number:
    1. Add profile display name prescribed by Meta. Make sure it’s associated with you business’s actual name. If it is not associated, Meta is likely to reject. For Research bots, we typically advise [business_name] + Research as your Display Name. See Display Name Guidelines article for more details.
    2. Choose category and business Description
    3. Add number: Select country code and add number to receive OTP via SMS or phone call to verify

Note:

Make sure you have the number ready to receive SMS or phone call
After adding your number, you might need to refresh the page if the number isn’t showing up
Screenshot 2023-11-01 at 08.45.44.png
Screenshot 2023-11-01 at 08.43.37.png

2.2 Setup Webhook

Go to the Configuration section and press “Edit” button in the webhook card section

  1. Enter Callback URL and Verify token (both of these keys will be provided to you by Yazi)
  2. Press “Verify and Save” button (it will do a pink test and automatically save)
Screenshot 2023-10-31 at 12.33.35.png

In the “Webhook fields” section directly below, press the “Manage” button

  1. Click ALL TICKBOXES in Subscribe column. This allows us to track and retrieve the data so make sure to tick every one!
Screenshot 2023-10-31 at 11.36.50.png

META BUSINESS MANAGER

3. Add payment method

In order for the WhatsApp account to activate, you need to add a card or payment method.

  1. Go to your Meta Business Manager to setup and select:
    1. WhatsApp Accounts
    2. Click on the new WA account
    3. Settings
    4. Payment Settings
Screenshot 2023-11-01 at 09.14.30.png

4. System User token

You have now entered what the identification that WhatsApp needs from our software system. Now, for our system to connect to your number, we need 3 items or identifiers from you. These are:

  1. System User token
  2. Phone number ID
  3. WhatsApp Business Account ID

4.1 Add System User if none existed

Head back to Business Manager to generate a system token from someone who is a System user:

Screenshot 2023-11-01 at 09.20.50.png

Go to Users and click on “System Users” (you need to be an Admin user to do this)

Note:

If no System user exists, Press the “Add” button → Set system user role to Admin
Difference between system user and regular user. System user doesn’t require a reset of the token after it expires because the system can be setup as permanent. If system is compromised then you can revoke

4.2 Add Asset

Click “Add Assets” and a Modal will pop up. Navigate the following:

  1. Click the “Apps” page
  2. Select your app you just created
  3. Toggle “Manage App” under Full control to be on
  4. Press “Save changes” button
Screenshot 2023-11-01 at 09.28.28.png
Screenshot 2023-11-01 at 09.28.02.png

4.3 Generate Token

  1. Click “Generate Token”
  2. Select your App
  3. Select “Never” for token expiration

Tick the following boxes

  •  Business Management
  •  WhatsApp business messaging
  •  WhatsApp Business management

When you've done this, Click “Generate Token” button

Note:

This is the identifier that will be sent back to Yazi to configure the system to your personal account. Once the code is generated, you can send it to Yazi to complete the configuration of your account
Selecting Never for Token expiration means you don’t have to keep configuring new tokens
Screenshot 2023-11-01 at 09.33.28.png
Screenshot 2023-11-01 at 09.35.27.png
Screenshot 2023-11-01 at 09.41.32.png
Screenshot 2023-11-01 at 09.41.56.png

META FOR DEVELOPERS

4.4 Access Token via Debugger

To copy or access the information about the token: Go to Access token page in Tools in the Facebook Developers portal https://developers.facebook.com/tools/accesstoken/

  1. Click “Debug” on the app you just created
  2. Copy the Debug code
Note: Also see all the information about the token
Screenshot 2023-11-01 at 09.50.13.png
Screenshot 2023-10-31 at 11.57.11.png

5. Copy Phone number ID and WhatsApp Business Account ID

Go back to API setup in the developers Portal

Copy the following:

  1. Phone number ID
  2. WhatsApp Business Account ID
  3. The actual WhatsApp number

Send these back to Yazi along with the System token

Screenshot 2023-11-01 at 09.54.49.png

6. Toggle App Mode onto Live

Toggle the app to “Live”. As this is approved, you will normally be upgraded to be able to send 1,000 Template messages per day (1,000 outbound notification messages per 24 hours)

Note: You may need to add your Privacy policy in Basic Settings to be able to do this.

Screenshot 2023-11-01 at 09.57.59.png
Screenshot 2023-11-01 at 09.58.32.png

Might take a day to populate.

Screenshot 2023-10-31 at 12.13.03.png

Additional profile check

  1. Check status of number
    1. Should take 1-2 business days to be approved
  2. Profile
    1. Add description
    2. Picture