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.
In the window that pops up, enter the name for the user and select the Admin role.
Click Create System User.
On the system user page, click Generate token.
A new window will pop up where you should specify token attributes:
You will see your token on the screen. Copy it and click Done.
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.
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.
In the Webhook section, specify the webhook callback URL:
Click Edit.
In the pop-up window that appears, enter the needed details.
Callback URL: https://textpeak-streams.commpeak.com/webhooks/whatsapp
Verify token: SismaKalaClick Verify and save.
Select the webhook fields:
IMPORTANT
We recommend that you select v18.0 in the Subscription version column.