Whatsapp message event occurred
Wavix sends these events to your webhook of the messages group when one of your senders receives a message, when a message you sent is sent, delivered, read, or fails, and when a contact stops or resumes marketing messages. A test event you send to the webhook arrives here too.
Each change is a separate event, and type names it, so your server can follow a conversation and the status of each message without polling. A media content has an id and a url; send a GET request to the url with your API key to download the file, as Download received media describes.
Behavior: Return a 2xx status within 10 seconds to acknowledge the event; Wavix doesn’t follow redirects, so a 3xx response counts as a failed attempt. After a failed attempt, Wavix retries about 5 seconds, 30 seconds, 2 minutes, 10 minutes, 1 hour, 6 hours, and 24 hours later, up to 8 attempts in total; a test event isn’t retried. Events can arrive more than once and out of order, so discard repeats by id and keep the state from the event with the latest timestamp. When two status events of a message share a timestamp, keep the later of sent, failed, delivered, read.
Requires: A webhook of the messages group. A disabled webhook gets only test events. Its URL must use https, have a valid TLS certificate, and resolve only to public addresses that Wavix allows. If the host resolves to another address at send time, Wavix doesn’t send the event and doesn’t retry it. Verify every request as the Standard Webhooks specification describes, with one of its libraries or by hand. The webhook-signature and webhook-timestamp headers give the steps.
Limits: List WhatsApp events keeps each event except test for 30 days, so you can catch up on events your server missed within that time.
Headers
Body
The event Wavix posts to your webhook URL.
- WhatsAppMessageReceivedEvent
- WhatsAppMessageSentEvent
- WhatsAppMessageDeliveredEvent
- WhatsAppMessageReadEvent
- WhatsAppMessageFailedEvent
- WhatsAppContactMarketingStoppedEvent
- WhatsAppContactMarketingResumedEvent
- WhatsAppWebhookTestEvent
Event that tells you one of your senders received a message. Posted to your webhook and returned by List WhatsApp events.
Response
Your server acknowledges the event. Any 2xx status counts as delivered.