Webhooks
Introduction
- Waba Notifications may be received by Client (web) application (in public domain) by subscribing to Webhooks. Configuring ‘Webhook Url’ in ‘Waba Settings’ Page in user login as shown in below screenshot will enable Waba Notifications to client application.
-
Incoming messages, if webhook url given, and Message Status updates, if ‘Post Status Notifications’ selected, will be posted (Mthod: POST) to ‘Webhook url’ (Http EndPoint) with query parameters ‘notificationtype’ and ‘secsha’ and client’s end point should respond with Http StatusCode 200. In case client endpoint fails to handle
-
The http endpoint for webhook must allow anonymous access without any authentication. Use ‘Webhook Secret’ to provide better security or say authentication to this endpoint.
-
notificationtype’
- will have value: inmsg’
- for Incoming Message – refer to Model for Json Body-
status’
- for Message Status Update – refer to Model for Json Body. -
In case client is interested only in Incoming messages and not interested in Status Notifications viz. Delivered, Read, etc then checkbox ‘Post Status Notifications’ should be kept unchecked to minimize needless traffic and data flow.
-
‘Webhook Secret’ if set, Sha256 of the secret will be passed as ‘secsha’ parameter to Webhook end point. Receiving application will also store the original webhook secret and would compare Sha256 of the original webhook secret with the received Sha256 to provide better security.
Client Webhook Models
InStatusClientWebhook Model
InStatusClientWebhook Model