If you don't want to implement Embedded Signup by adding JavaScript code to your website or customer portal, you can instead use a link that, when clicked, displays a web page describing onboarding steps, and a button that launches the Embedded Signup flow:
Hosted Embedded Signup ("Hosted ES") can only be used to onboard business customers to Cloud API, and the flow cannot be customized.
You will also need:
If you don't already have a Facebook Login for Business configuration, you must create one. A Facebook Login for Business configuration defines which permissions to request, and what additional information to collect, from business customers who access Embedded Signup.
Navigate to Facebook Login for Business > Configurations and click the + Create configuration button to access the configuration flow.
Use a name that will help you differentiate this configuration from any others you may create in the future. When completing the flow, be sure to select the WhatsApp Embedded Signup login variation:
When choosing assets and permissions, select only those assets and permissions that you will actually need from your business customers.
For example, if you select the Catalogs asset but don't actually need access to customer catalogs, your customers will likely abandon the flow at the catalog selection screen and ask you for clarification.
Navigate to the WhatsApp > Quickstart panel and click the View onboarding button.
Locate the Zero integration onboarding card. The URL displayed in the card is the onboarding page URL:
Click the Copy button to copy the URL to your clipboard. Map this URL to a button on your website or customer portal that, when clicked, opens the URL in a new browser window.
To see what this looks like, you can load the URL in a new browser window or tab, or click the blue "new window" icon, which does the same thing.
This onboarding page looks like this:
Click the Get started button. This is the flow that business customers who click the button on your website or customer portal will see. Complete the flow if you wish.
When a business customer completes the flow, an account_update webhook is triggered with event set to PARTNER_ADDED. Capture the customer's WhatsApp Business Account ID and business portfolio ID from the webhook payload.
Generate an HMAC-SHA256 hash of your app secret and system token.
echo -n "<SYSTEM_TOKEN>" | openssl dgst -sha256 -hmac "<APP_SECRET>"
<SYSTEM_TOKEN> — Your system token.<APP_SECRET> — Your app secret (App Dashboard > App settings > Basic)Use the POST /<BUSINESS_PORTFOLIO_ID>/system_user_access_tokens endpoint to get and capture the customer's business token. (Target the customer's business portfolio ID, not yours).
curl 'https://graph.facebook.com/<API_VERSION>/<BUSINESS_PORTFOLIO_ID>/system_user_access_tokens' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Authorization: Bearer <SYSTEM_TOKEN>' \ -d 'appsecret_proof=<APPSECRET_PROOF>' \ -d 'fetch_only=true'
<API_VERSION> — API version.<APPSECRET_PROOF> — HMAC-SHA256 hash of your app secret and system token.<BUSINESS_PORTFOLIO_ID> — Business customer's business portfolio ID.<SYSTEM_TOKEN> — Your system token.Upon success:
{
"access_token": "<BUSINESS_TOKEN>"
}<BUSINESS_TOKEN> — The business customer's business token.Use the GET /<WHATSAPP_BUSINESS_ACCOUNT_ID>/phone_numbers endpoint to get and capture the business customer's business phone number ID.
curl 'https://graph.facebook.com/<API_VERSION>/<WHATSAPP_BUSINESS_ACCOUNT_ID>/phone_numbers' \ -H 'Authorization: Bearer <BUSINESS_TOKEN>'
<API_VERSION> — API version.<BUSINESS_TOKEN> — Business customer's business token.<WABA_ID> — Business customer's WhatsApp Business Account ID.{
"data": [
{
"verified_name": "<VERIFIED_NAME>",
"code_verification_status": "<CODE_VERIFICATION_STATUS>",
"display_phone_number": "<DISPLAY_PHONE_NUMBER>",
"quality_rating": "<QUALITY_RATING>",
"platform_type": "<PLATFORM_TYPE>",
"throughput": {
"level": "<THROUGHPUT_LEVEL>"
},
"last_onboarded_time": "<LAST_ONBOARDED_TIME>",
"webhook_configuration": {
"application": "<WEBHOOK_CALLBACK_URL>"
},
"id": "<BUSINESS_PHONE_NUMBER_ID>"
}
]
}<BUSINESS_PHONE_NUMBER_ID> — Business phone number ID.<CODE_VERIFICATION_STATUS> — Business phone number verification status.<DISPLAY_PHONE_NUMBER> — Business display phone number.<LAST_ONBOARDED_TIME> — Unix timestamp indicating when the number was added the business customer's WhatsApp Business Account (essentially, when the customer successfully completed the flow.)<PLATFORM_TYPE> — Platform.<QUALITY_RATING> — Business phone number quality rating.<THROUGHPUT_LEVEL> — Throughput level.<VERIFIED_NAME> — Business phone number verified name.<WEBHOOK_CALLBACK_URL> — Webhook callback URL associated with the number.Onboard the business customer by completing the steps in the appropriate onboarding guide below: