Criando um SAAS Real do Zero - Aula 54 - Webhooks UAZAPI Integração WhatsApp

In this fifty-fourth lesson of the "Creating a Real SaaS from Scratch" series, you will learn how to configure UAZAPI webhooks to receive WhatsApp events in real time. Understand the difference between global and individual webhooks, the types of events available, and how to process messages. WEBHOOKS EXPLAINED: Webhook = endpoint that receives WhatsApp notifications. Whenever something happens (message, connection, call), UAZAPI sends data to your URL. TWO TYPES OF WEBHOOK: Individual Webhook: Configured per instance Works only on that specific instance Useful for testing and development Used in the course for each student Global Webhook: Configured once Works for all instances Future instances automatically included Used in production AVAILABLE EVENTS: Connection: connect/disconnect Messages: sent/received messages ✅ Messages update: message status Messages delete: deleted messages Calls: voice/video calls Presence: online, typing, recording Groups: group events Chats: conversations Contacts: contacts EVENTS TO MONITOR: Check only what is necessary to avoid overloading the server. For basic chat: only "Messages". EXCLUSION OPTIONS: Sent by API: Excludes messages sent by the API itself Prevents infinite loops with bots Bot receives → replies → receives its own reply → loop ALWAYS check this option From me: Excludes messages sent by the connected number Useful for not processing your own messages Groups: Excludes messages from groups Check if you only work with individual chat MESSAGE PAYLOAD: Received information: Message ID Sender's number Message content Type (text, audio, image, video) Timestamp Chat ID Profile picture SSE EVENTS (Server-Sent Events): Alternative to webhooks: Real-time connection via websockets Works only with the screen open Useful for inspecting payloads DO NOT use in production Good for Development/Debugging DIFFERENCE BETWEEN WEBHOOK AND SSE: Webhook: Works 24/7 Server receives events Production ✅ SSE: Works only with the screen open Front-end receives events Development only ✅ COURSE CONFIGURATION: Each student creates their own instance Configures individual webhook Tests with webhook.site Then uses their own local server PRODUCTION CONFIGURATION: Global webhook configured once All instances work automatically Endpoint of your server Background processing TESTING WEBHOOKS: Use webhook.site for quick tests: 1. Copy the generated URL 2. Paste it into the UAZAPI webhook 3. Check "Messages" 4. Save 5. Send a test message 6. View the payload webhook.site NEXT STEPS: Expose localhost to the internet (ngrok) Process webhooks in the backend Save messages in the database Reply automatically Integrate with AI agents #WebhooksUAZAPI #WhatsAppIntegration #CreateSaaS #WhatsAppEvents #WhatsAppAPI #GlobalWebhook #SSEEvents #NextJS #RealSaaSFromScratch #UAZAPI ► Important topics to facilitate content absorption: 00:00:00 Introduction: UAZAPI webhooks and events 00:00:23 Creating a new channel in the system 00:00:49 Connecting WhatsApp via QR Code 00:01:41 Shared vs. own UAZAPI panel 00:02:48 Global webhook vs. individual webhook 00:03:48 Registering an endpoint webhook 00:04:13 Events to monitor: available types 00:05:19 Saving webhook configuration 00:06:12 Testing message reception 00:07:04 Audio message event 00:07:34 Group messages: how they work 00:08:43 Deleting messages: sent by API 00:09:36 From me option: own messages 00:10:24 Disabling group notifications 00:11:19 Individual webhook: configuration per instance 00:12:13 Global webhook: all instances 00:12:51 Receiving duplicate events (global + individual) 00:13:59 SSE events: real-time connection 00:15:25 Difference between webhook and SSE events 00:16:14 SSE event limitation: only with open screen 00:16:36 Deleting test instance ► Important links: 🔷 SaaS Accelerator: Step-by-step guide on our Complete Method for creating SaaS with AI (essential lessons to follow in this playlist "Creating a SaaS from Scratch"): https://www.aceleradorsaas.com.br/ 🔷 Complete Playlist "Creating a Real SaaS from Scratch":    • Criando um SAAS Real do Zero - Aula 01 - S...   🔷 Follow the Datafy Chats journey on our channel:    / @datafychats