Creating a Token for WhatsApp Business
to get the WhatsApp account ID, and how to configure webhooks to be alerted about WhatsApp-related actions.
As one of the steps of creating a WhatsApp API stream, you need to enter a WhatsApp Business token and your WhatsApp Business ID.
This article will describe how to generate this token and where to get the WhatsApp account ID.
You will also learn how to configure Webhooks in your app to be alerted at WhatsApp-related actions.
Generating a WhatsApp Business Token
To create a token:
-
In your Meta Business Suite account, navigate to the settings menu (the gear icon), expand Users, and select System Users. You can also use the following link: https://business.facebook.com/settings/system-users.
-
Click Add.
Meta System Users section
-
In the window that pops up, enter the name for the user and select the Admin role.
-
Click Create System User.
Create system user dialog
-
On the system user page, click Generate token.
Generate token button
-
A new window will pop up where you should specify token attributes:
-
Select the app for which you are creating the token.
Select app step
-
Select the token expiration option.
NOTE
Please make sure you select Never as you are creating a permanent token.
Set expiration step
-
Assign permissions to the app: whatsapp_business_management and whatsapp_business_messaging.
Assign permissions step
-
Click the Generate token button.
Generate token button
-
-
You will see your token on the screen. Copy it and click Done.
Done step
-
You can now insert the token in the Auth token field when you create a WhatsApp stream.
Getting the WhatsApp Business ID
-
Expand the Accounts section in the settings menu and select WhatsApp accounts. Alternatively, use the link: https://business.facebook.com/settings/whatsapp_account
-
Copy the ID under the needed WhatsApp account.
Meta WhatsApp accounts section
Use this ID for the Business ID field.
Configuring Webhooks
Set up webhooks for your app to be alerted when you receive a message or when its status changes.
To set up webhooks:
-
Go to your account at Meta for Developers, navigate to Apps (https://developers.facebook.com/apps/), and select the needed app.
-
In the main menu on the left, expand the WhatsApp section and select Configuration.
Meta Configuration section
-
In the Webhook section, specify the webhook callback URL:
-
Click Edit.
Editing configuration
-
In the pop-up window that appears, enter the needed details.
Callback URL: _https://textpeak-streams.commpeak.com/webhooks/whatsapp_
Verify token: SismaKala -
Click Verify and save.
-
-
Select the webhook fields:
-
Click Manage.
-
In the window that pops up, select the following webhook fields:
messages
phone_number_name_update
template_category_updateWebhook fields window
-
Click Done.
-
IMPORTANT
We recommend selecting v18.0 in the Subscription version column.

Webhook section
Updated 6 days ago