Webhooks allows you to receive real-time HTTP notifications of changes to specific request, updates on various settings of account, incoming message etc.. For example, WhatsApp sends a notification when a user sends a message or when a message template’s status has changed.
Table of Contents
WhatsApp posts notifications, updates, incoming messages etc. to a Webhook at real time to ensure an automated workflow for messaging and compliance to effective business rules of Meta. WhatsApp posts JSON Payloads of pre-defined format for different type of events as RAW Body in the HTTP Request.
Each WhatsApp Business Phone number associated with a WhatsApp Project must be configured with a Webhook through EnableX Portal.
Your Webhook Host
- HTTPS Host: All posts on your Webhook are sent using HTTPS, so your server must be able to receive and process HTTPS requests,
- TLS/SSL Certificate: Webhook Host must have a valid TLS/SSL Certificate installed. Self-signed certificates are not supported.
- Raw Body Posts: JSON Contents are posted over Webhook as Raw Body. So, Webhook must look to read Raw Body to process and take necessary action.
- HTTP 200 Response: Any notification or message posting to Webhook URL must be acknowledged by returning HTTP 200 header in the same connection. Given below an example of responding with HTTP 200 using PHP Code:
<?php header("HTTP/1.1 200 OK"); ?>
Type of Posts
The following type of notifications and messages will be posted to the Webhook
- Incoming Messages: Whenever there is a incoming message sent by any user/customer, you get it posted.
- Delivery Notification: Whenever there is a status updates on the message sent to any user/customer, viz. sent, failed, read etc., you get notified.
- Template Updates: Whenever a new template submission gets approved or rejected; or if an approved template gets paused or disabled on spam complaints, you get notified.
- Action/Reactions: Whenever user reacts with Emojis on a message sent, or acts on it (e.g. deletes a message); you get notified.