API Documentation
Welcome to the IT DPUPR Banten WhatsApp Gateway API documentation. Our API allows you to programmatically send messages, manage devices, and broadcast campaigns using WhatsApp for internal operational needs.
Quick Start
Generate API Key
Create your authentication key from the API Keys page.
Connect Device
Scan the QR code to connect your WhatsApp account.
Start Sending
Use our API endpoints to send your first message.
Authentication
All API requests require authentication using a Bearer token. Include your API key in the Authorization header.
Base URL
https://wa.dpupr.com/api/v1
Example Header
Authorization: Bearer YOUR_API_KEY
Device Management
Manage your connected WhatsApp devices programmatically.
Create Device
Create a new device session and retrieve the QR code for connection.
/devices
curl -X POST https://wa.dpupr.com/api/v1/devices \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
List All Devices
Retrieve a list of all your connected devices.
/devices
Sending Messages
Send text messages to any WhatsApp number.
Send Single Message
/messages/send
Parameters
-
session_nameRequired. The session name of your connected device. -
numberRequired. Recipient phone number (e.g., 628123456789). -
messageRequired. The text message content.
Example Request
{
"session_name": "YOUR_DEVICE_SESSION",
"number": "628123456789",
"message": "Hello from API!"
}
Broadcasting
Send messages to multiple recipients efficiently with built-in delays.
/messages/broadcast
{
"session_name": "YOUR_DEVICE_SESSION",
"numbers": ["628123456789", "628987654321"],
"message": "This is a broadcast message",
"delay": 3000
}
Response Formats
All API responses follow a consistent JSON structure.
Success Response
{
"status": true,
"message": "Operation successful",
"data": { ... }
}
Error Response
{
"status": false,
"message": "Error description",
"error": "Detailed error info"
}
Error Handling
Common HTTP status codes and their meanings.
| Code | Description |
|---|---|
| 401 | Unauthorized. Invalid or missing API key. |
| 400 | Bad Request. Missing parameters or invalid data. |
| 429 | Too Many Requests. Rate limit exceeded. |
| 404 | Not Found. Device or resource not found. |
Rate Limits & Best Practices
- Respect Delays: When broadcasting, we automatically handle delays. Do not force send messages faster than your plan allows to avoid blocking.
- Keep Keys Secure: Never expose your API keys in client-side code (browsers). Always proxy requests through your own backend.