Webhooks are one of a few ways web applications can communicate with each other. It allows you to send real-time data from one application to another whenever a given event occurs. You can use the webhook to determine to which endpoint we should forward the real-time data (or also known as Notifications). Whenever that trigger event occurs, the WhatsApp Business API client sees the event, collects the data, and immediately sends a notification (user-defined HTTP callbacks) to the webhook URL specified in the application settings. Some example events are: - updating the status of sent messages - indicating when you receive a message.
It is important that your webhook returns an HTTPS 200 OK
response to any notifications. Otherwise we consider that notification as failed and try again after a short delay.
Only use asynchronous handling of callbacks - acknowledge immediately after receiving the callback, then process
The webhook URL is a URL where the WhatsApp Business API sends the notifications to, triggered by specific events.
The webhook URL can either be: - the URL from your own application - or the partner.
{"url": URL,"headers": {"header_1": string,"header_2": string}}
HTTP response status code
that indicates that the server was unable to process the request sent by the client due to invalid syntax.{"meta": {"success": false | true,"http_code": 400,"developer_message": string,"details": [string]}}
{"meta": {"success": false,"http_code": 500,"developer_message": string}}
{"url": URL,"headers": {"header_1": string,"header_2": string}}
If the webhook URL needs to be authorized by user, USER
and PASS
should be provided in the header Authorization
that contains Basic base64(USER:PASS)
.
Request body example for USER=testuser
and PASS=testpass
{"url": "https://www.example.com/webhook","headers": {"Authorization": "Basic dGVzdHVzZXI6dGVzdHBhc3M="}}
If the webhook URL is already set up as described above, you can send a GET request to get the URL.
{"url": URL,"headers": {"header_1": string,"header_2": string}}
HTTP response status code
that indicates that the server was unable to process the request sent by the client due to invalid syntax.{"meta": {"success": false | true,"http_code": 40X,"developer_message": string,"details": [string]}}
{"meta": {"success": false,"http_code": 500,"developer_message": string}}
D360-API-KEY: adafABC43Content-Type: application/json
{"url": "https://www.example.com/webhook","headers": {"Authorization": "Basic dGVzdHVzZXI6dGVzdHBhc3M="}}
​