WhatsApp Integration
⏱️5 minutes
Configure Z-API to enable WhatsApp messaging for AD Unlock.
About Z-API
AD Unlock uses Z-API to send and receive WhatsApp messages. Z-API provides a simple API to interact with WhatsApp.
Z-API requires a phone with WhatsApp to remain connected. For production, consider WhatsApp Business API for higher reliability.
Steps
1. Create Z-API Account
- Go to z-api.io
- Create an account
- Create a new instance
2. Get Credentials
From the Z-API dashboard, note:
| Value | Location |
|---|---|
| Instance ID | Dashboard → Your Instance |
| Token | Dashboard → Your Instance → Token |
3. Connect WhatsApp
- In Z-API dashboard, click Connect
- A QR code will appear
- On your phone, open WhatsApp → Settings → Linked Devices
- Scan the QR code
✅Expected Result
Z-API dashboard shows:
- Status: Connected
- Phone number displayed
4. Configure in AD Unlock
- In Admin Portal, go to Settings → WhatsApp
- Enter:
| Field | Value |
|---|---|
| Instance ID | From Z-API |
| Token | From Z-API |
| Webhook URL | Copy from AD Unlock |
5. Configure Webhook in Z-API
- Copy the Webhook URL shown in AD Unlock portal
- In Z-API dashboard, go to Webhooks
- Configure:
| Setting | Value |
|---|---|
| URL | The webhook URL from AD Unlock |
| Events | on-message-received |
- Save
6. Verify Integration
Send a test message from AD Unlock:
- In Admin Portal, go to Settings → WhatsApp
- Click Send Test Message
- Enter your phone number
- Click Send
✅Expected Result
You should receive a WhatsApp message:
“This is a test message from AD Unlock. Your integration is working!”
🔧If Something Goes Wrong
| Symptom | Cause | Solution |
|---|---|---|
| QR code doesn't scan | WhatsApp version issue | Update WhatsApp to latest version |
| Disconnected frequently | Phone going to sleep | Keep phone charged and connected to WiFi |
| Messages not received | Webhook not configured | Verify webhook URL in Z-API |
| Test message fails | Wrong instance ID or token | Verify credentials match Z-API dashboard |
Production Considerations
For production use, consider:
- Dedicated phone that stays connected 24/7
- WhatsApp Business API (more reliable, no phone needed)
- Monitoring for disconnection alerts
Next Step
Last updated on