Resolving WhatsApp Business API Webhook Issue
Issue Description:
When the user sends a message to the business number, the configured WhatsApp webhook does not trigger, even though the subscription appears to be properly set up.
Identified Cause:
This issue is caused by a limitation in Meta's systems, where the associated phone number cannot be located within the business portfolio. This results in the webhook failing to function as expected.
Step-by-Step Resolution:
Step 1: Verify the Business Portfolio Name:
1. Navigate to WhatsApp - > API Setup in your Meta developer dashboard
2. Under Phone Numbers, check the Business Portfolio Name associated with your phone number (e.g., `ServiceDesk` in this case) and make a note of it.
Step 2: Reset and Reassign System User Assets:
1. Go to Business Settings.
2. Select System Users.
3. Revoke all existing tokens for the system user.
4. Reassign assets:
- Click on the three dots (...) near Revoke tokens and choose Assign assets - > Assign the App name from the Developer dashboard with full control.
- Under WhatsApp accounts, assign the WhatsApp Account identified in Step 1 as the associated account with full control.
5. Generate a new token for the system user.
Step 3: Re-subscribe to the Messages Webhook:
1. Attempt to re-subscribe to the Messages Webhook.
2. If the webhook still does not trigger, proceed to the API-based solution.
3.If it works, update the access token in the WhatsApp configuration page inside the ServiceDesk Plus application.
Step 4: Use the Meta Graph API for Subscription:
The WhatsApp account ID is needed for this process, which can be found under your phone number in the API setup page of the Meta developer dashboard.
1. Configure a webhook with the below configuration:
- URL:
`https://graph.facebook.com/v21.0/<whatsapp_account_id>/subscribed_apps`
- Replace `<whatsapp_account_id>` with the actual WhatsApp account ID.
2. GET API Call:
-URL:
`https://graph.facebook.com/v21.0/<whatsapp_account_id>/subscribed_apps`
- Replace `<whatsapp_account_id>` with the actual WhatsApp account ID.
HTTP method: GET
Save and execute the webhook once from the list view page.
- This call will return a confirmation of the subscription status.
Step 5: Verify Functionality:
- Once the subscription is confirmed via the GET API response, test the webhook by sending a message to the business number and ensure it is triggering as expected.
Additional Notes:
- If the issue persists despite following these steps, contact Meta support with the error details and the steps you've already taken.
By following these detailed steps, the WhatsApp Business API webhook issue should be resolved effectively.