Unable to programmatically set WhatsApp / Instagram webhook subscriptions
I would like to call for suggestions regarding a challenge I've been trying to solve recently involving Meta API & Webhooks. I assume this particular setting has not been addressed here before.
As one may know, to configure receiving requests from WhatsApp, Facebook, and Instagram for a Meta app you need setting up a webhook for each in the respective parts of Meta dev dashboard. This involves allowing webhooks required app-level subscriptions/permissions and providing an endpoint that you confirm by returning a verify token on a GET request to ensure it's ok to send you requests there.
In my case, I would like other people to use the app as well, so I added oath2 to get necessary permissions for user business pages on Wa, Fb or Instagram, which works well.
After that, with necessary access, you can add your or someone's page to a pre-configured webhook, so it starts accepting requests. This action can be done through a dashboard in the menu that looks similar to this depending on the platform.
On the other hand, this can be done with sending a request, specifying webhook subscription fields yourself (such as messages on the picture above).
POST /v20.0/{app-id}/subscriptions HTTP/1.1
However, this feature is only available for Facebook pages and in the request-dedicated article we can see it mentioned. Any other webhook-related requests actually allowed for WhatsApp and Instagram are only for adding a webhook to an app (the very first step described here).
Limitations:
Webhooks for Instagram is not supported. Instagram webhooks must be configured using the App Dashboard. Webhooks for WhatsApp is not supported. WhatsApp webhooks must be configured using the App Dashboard. https://developers.facebook.com/docs/graph-api/reference/v20.0/app/subscriptions
And given that, one needs to do it through dev dashboard UI which is not an acceptable solution in my case.
Therefore, I can really use some insights on how can this be solved directly or through some witty alternative to receive messages from all three platforms and being able to programmatically allow webhook page requests.
Additionally, I have been considering raising the issue with Meta directly, so it can be adjusted and would love to hear thoughts on potentially doing this.
P.S.
For those deeply interested in the issue, I found some sort of similar issue on the meta dev forum https://developers.facebook.com/community/threads/799110895741478/