Categories
Print

WhatsApp Business API from Meta

Prerequisites: 


To get WhatsApp Business API from Meta, you need to ensure following two criteria’s are met.


  1. 1. Your Business Manager is verified by Facebook 

  2. 2. You don’t have active WhatsApp account linked with the number


How do I get WhatsApp Business API from Meta? 


The process to obtain the WhatsApp Business API from Meta is divided into 4 parts: 


  1. 1. Creating an Application on Meta Developer Portal

  2. 2. Configuring the phone number of the sender

  3. 3. Generating the permanent token from Meta

  4. 4. Configuring Meta provider on i-genie and setting up the Web-hook URL on Meta


Now let’s understand each step in to detail: 


Create an Application: 


You can follow the following steps to create the Application: 


1 – Go to the website Meta for Developers: developers.facebook.com


2 – On the top right corner, click “log In” and give your Facebook credentials (Email & Password)


3 – After successful login, click on “My Apps” option in the top right corner


4 – Click on “Create App”


5 – Choose “Business” as option and click “Next”


6 – Define following


  • * App Name:
    Give an appropriate name to the Application

  • * Contact Email:
    Provide your email address linked with Facebook

  • * Business Account:
    Select the business account which is verified and you want the app to be associated with


7 – Click on “Create App” to create the App


8 – Under “Add products to your app”, click on “Set up” against “WhatsApp”

Once the App is created for WhatsApp, you will get a temporary token (expires in 23 hours), sender’s test number, phone number ID, WhatsApp Business ID & template for testing purpose


Add phone number of the sender:


To link the API & run the bot on your number, you will then need to configure the sender’s number. You can following the following steps to configure the same:


1 – Go to “Getting Started” under “WhatsApp” on the left panel


2 – Go to “Step 5: Add a phone number” & click on “Add phone number”


3 – Configure the following to fill in your business details:

  • * Business Name: Mention the name of your business
  • * Business Website: Provide the website address of your business
  • * Country: Select the country of your business is based out in


4 – Click “Next” to proceed further


5 – Configure following to setup WhatsApp Business Profile:

  • * WhatsApp Business Profile Display Name: The name that will appear to your customers
  • * Timezone: The timezone in which your business will be operating
  • * Category: Choose the category of the business from the available options
  • * Business Description: Provide short description about what your business does


6 – Click “Next” to proceed further7


7 – Configure following to add a phone number for WhatsApp:

  • * Phone Number: Choose the country code and mention the number in the space provided agains the country code
  • * Choose the verification method: This will send the verification code to your phone number. You can either select “Text Message” or “Phone Call” for the verification


8 – Click “Next” to verify phone number9


9 – Verify your phone number using the code received and click “Next” to configure the phone number



Generate Permanent Token:


The next step is to generate the permanent token for the API configured with the phone number. You can follow the following steps to generate the permanent token


1 – Go to business.facebook.com


2 – Click on “Settings” gear against your business account


3 – Under “Users” on the left panel, go to “System Users”


4 – Click on “Add” to create the system user and configure the following:

  • System Username: Provide the system username as per your preference
  • System User Role: Select the role as “Admin” 


5 – Click on “Create System User” to create the system user6


6 – Once the system user is created, click on “Add Assets” on the “System Users” page & assign assets to created system user & configure the following

  • On the left menu panel in pop-up window, click on “Apps” to select it as the assets type
  • Select the created app under “Select Assets”
  • Switch on “Manage App” under “Full Control” under “App”


7 – Click on “Save Changes” to assign assets to the created user


8 – Under “Accounts” on the left panel, go to “WhatsApp Accounts”


9 – Click on “Add People” & configure following

  • Select the recently created system user under “Select People”
  • Switch on “Manage WhatsApp Account” under “Assign Access”


10 – Click on “Assign” to save the changes


11 – Go back to “System Users” under “Users” on the left panel


12 – Select recently created system user


13 – Click on “Generate New Token” to create permanent token


14 – Choose your “WhatsApp Business App”


15 – Check following two permissions from the list

  • Whatsapp_business_management
  • Whatsapp_business_messaging


16 – Click on “Generate” again to generate the token.We at i-genie recommend to have the token copied and saved offline for easy access in future



Configure Meta Provider on i-genie & set up the Webhook URL on Meta:


Once the permanent token is generated, you can follow the following steps to configure the bot on your WhatsApp Number:


1 – Sign in to i-genie App: app.i-genie.co.uk


2 – Go to “Channel Configuration > WhatsApp > Configuration”


3 – Click on “+ WhatsApp Configuration”


4 – Configure following:

  • Phone Number (with country code but without “+” sign)
  • Copy “WhatsApp Business Account ID” from Meta and paste it in the space provided
  • Copy “App ID” from Meta and paste it in the space provided
  • Copy “Phone Number ID” from Meta and paste it in the space provided
  • Copy “Permanent Token” & paste it in the space provided


5 – Click on “Save” to save the configuration


6 – Once the configuration is successful, the Webhook URL will be generated by i-genie. Copy the “Webhook URL”


7 – Now go back to application created on Meta


8 – Go to “Configuration” under “WhatsApp” in the left panel


9 – Click on “Edit” against “Callback URL”


10 – Paste the “Webhook URL” generated by i-genie along with “Permanent Token” in the space provided


11 – Click on “Verify & Save” to save the configuration


12 – Once the “Webhook URL” is configured, click on “Manage” against “Webhook Fields”


13 – Click on “Subscribe” against “Messages”


14 – Click “Done” to activate the API on WhatsApp

Once you have completed these steps, you should be able to see the bot active on WhatsApp number and able to exchange messages with the bot on WhatsApp


Once you have completed these steps, you should be able to see the bot active on WhatsApp number and able to exchange messages with the bot on WhatsApp