Hi all,
I'm trying to configure the necessary webhook to use WhatsApp Business without success.
This is what needs to be configured on Meta/WhatsApp side:
I've exposed a REST API with an Authorization parameter in the Header but it doesn't seem to be the expected.
What kind of parameter should be created to act as token in this Exposed API and be validated when the API is called externally?
Many thanks.
Hi
If you add a webhook WhatsApp performs a GET Request to your configured endpoint. This GET Request comes with 3 Query String parameters
hub.mode (this one will always be a string containing "subscribe"
hub.challenge (this will be an Integer value which needs to be returned by your endpoint)
hub.verify_token ( the verify token you set when creating the webhook)
Your endpoint needs to have the three parameters as url parameters.
The logic in you flow would be
Check if the hub.mode query string parameter contains the string "subscribe"
Check if the hub.verify_token matches your Token (eg. stored in a site property)
If all passes return the value of hub.challenge
In all other cases respond with a 403 Status code.
Events itself are sent to your endpoint as POST after succesful validating your endpoint. So in the end you have the same path listening to GET and POST.
You can read more here https://developers.facebook.com/docs/graph-api/webhooks/getting-started#event-notifications
Best
Stefan
PS: To look into webhook messages i recommend this https://webhook.site/
Thanks Stefan, this documentation page escaped me.
Now I face another issue:
OutSystems doesn't allow "." in parameters, converting it to "_".
hub.mode is converted to hub_mode and not recognized by meta call.
I guess you owe me a beer ;-)
The parameter name cannot contain dots. BUT the Name in Request field does.
Perfect! I'm needing a documentation review!