API Documentation
WA Gateway is API-compatible with Wablas. Swap the base URL and your existing integrations work out of the box.
Getting Started
Base URLs
Wablas-compatible endpoint
POST https://wa.fujicon.id/api/send-messageNative REST API
GET https://wa.fujicon.id/api/v1/devicesQuick start
- 1
Get an API key
Go to Settings → API Keys and create a new key. Copy the token — it won't be shown again.
- 2
Get a Device ID
Go to Devices and copy the ID of the device you want to send from. Pass it as
device_idin the body or via theX-Device-IDheader. - 3
Send your first message
Make a POST to
/api/send-messagewith your token and device ID. Done.
Authentication
Bearer header (recommended)
Authorization: Bearer YOUR_TOKENQuery parameter (alternative)
https://wa.fujicon.id/api/send-message?token=YOUR_TOKENObtain an API key from Settings → API Keys. Keys are scoped to your account and can be revoked at any time.
Example — curl
curl -X POST https://wa.fujicon.id/api/send-message \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"phone":"628xxxxxxxxx","message":"Hello!","device_id":"YOUR_DEVICE_ID"}'Device
/api/device/infoReturns the current status and details of a connected device.
Request headers / query
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | header | required | Bearer token. e.g. Authorization: Bearer YOUR_TOKEN |
X-Device-ID | header | optional | Device ID. Alternative: ?device_id= query param. |
device_id | query | optional | Device ID (alternative to X-Device-ID header). |
Response
{
"status": true,
"message": "Device info",
"data": {
"phone": "628xxxxxxxxx",
"device": "My iPhone",
"status": "connected",
"battery": 87,
"platform": "ios"
}
}Send Text Message
/api/send-messageSend a plain-text WhatsApp message to one recipient.
Request body (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
phone | string | required | Recipient phone in international format. e.g. 628xxxxxxxxx |
message | string | required | Plain-text message content. |
device_id | string | optional | Device to send from. Can be passed via X-Device-ID header instead. |
Response
{
"status": true,
"message": "Message sent",
"data": {
"messages": [
{
"phone": "628xxxxxxxxx",
"messageId": "3EB0C767D97B1C6A1C23",
"status": "sent"
}
]
}
}Example — curl
curl -X POST https://wa.fujicon.id/api/send-message \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "628xxxxxxxxx",
"message": "Hello from WA Gateway!",
"device_id": "YOUR_DEVICE_ID"
}'Example — JavaScript (axios)
import axios from 'axios'
const res = await axios.post('https://wa.fujicon.id/api/send-message', {
phone: '628xxxxxxxxx',
message: 'Hello from WA Gateway!',
device_id: 'YOUR_DEVICE_ID',
}, {
headers: { Authorization: 'Bearer YOUR_TOKEN' },
})
console.log(res.data)Send Image
/api/send-image Send an image with an optional caption. The image field accepts a public URL or a base64-encoded data URI.
Request body (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
phone | string | required | Recipient phone in international format. |
image | string | required | Public URL or base64-encoded data URI of the image. |
caption | string | optional | Optional caption shown below the image. |
device_id | string | optional | Device to send from. |
Example — curl
curl -X POST https://wa.fujicon.id/api/send-image \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "628xxxxxxxxx",
"image": "https://example.com/photo.jpg",
"caption": "Check this out!",
"device_id": "YOUR_DEVICE_ID"
}'Broadcast
/api/broadcast Send personalised messages to multiple recipients in one request. Supports template variables — use {{name}}, {{order}}, etc. and provide matching keys per recipient object.
Request body (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
data | array | required | Array of recipient objects. Each must have phone and message keys. |
data[].phone | string | required | Recipient phone in international format. |
data[].message | string | required | Message text. May contain {{variable}} placeholders. |
data[].* | string | optional | Any extra keys become template variables, e.g. name, order. |
device_id | string | optional | Device to send from (applied to the entire batch). |
Example — curl
curl -X POST https://wa.fujicon.id/api/broadcast \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"device_id": "YOUR_DEVICE_ID",
"data": [
{
"phone": "628111111111",
"message": "Hi {{name}}, your order {{order}} is ready!",
"name": "Alice",
"order": "#1001"
},
{
"phone": "628222222222",
"message": "Hi {{name}}, your order {{order}} is ready!",
"name": "Bob",
"order": "#1002"
}
]
}'Example — JavaScript (axios)
import axios from 'axios'
const res = await axios.post('https://wa.fujicon.id/api/broadcast', {
device_id: 'YOUR_DEVICE_ID',
data: [
{
phone: '628111111111',
message: 'Hi {{name}}, order {{order}} is ready!',
name: 'Alice',
order: '#1001',
},
{
phone: '628222222222',
message: 'Hi {{name}}, order {{order}} is ready!',
name: 'Bob',
order: '#1002',
},
],
}, {
headers: { Authorization: 'Bearer YOUR_TOKEN' },
})Send List / Menu
/api/send-listSend an interactive list message. Recipients tap a button to open a grouped menu and select an option.
Request body (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
phone | string | required | Recipient phone in international format. |
body | string | required | Message body text. |
footer | string | optional | Small italic text below the body. |
buttonText | string | required | Label of the button that opens the list. |
sections | array | required | Array of section groups. |
sections[].title | string | required | Section heading. |
sections[].rows | array | required | Array of row items in this section. |
sections[].rows[].id | string | required | Unique ID returned when the row is selected. |
sections[].rows[].title | string | required | Row label. |
sections[].rows[].description | string | optional | Optional sub-text shown below the title. |
device_id | string | optional | Device to send from. |
Example body
{
"phone": "628xxxxxxxxx",
"body": "Please select your preferred delivery time:",
"footer": "We will confirm by WhatsApp",
"buttonText": "Choose time slot",
"sections": [
{
"title": "Today",
"rows": [
{ "id": "slot_morning", "title": "09:00 - 12:00", "description": "Morning delivery" },
{ "id": "slot_afternoon", "title": "13:00 - 17:00", "description": "Afternoon delivery" }
]
},
{
"title": "Tomorrow",
"rows": [
{ "id": "slot_tomorrow_am", "title": "09:00 - 12:00" },
{ "id": "slot_tomorrow_pm", "title": "13:00 - 17:00" }
]
}
],
"device_id": "YOUR_DEVICE_ID"
}Webhook
/api/webhook/setRegister a URL to receive incoming messages and device events. WA Gateway will POST a JSON payload to your URL whenever a message arrives or a device status changes.
Request body (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
url | string | required | HTTPS URL that will receive POST requests on incoming events. |
device_id | string | optional | Scope to a specific device. Omit to receive events from all devices. |
Webhook payload shape (sent to your URL)
{
"phone": "628xxxxxxxxx",
"message": "Hello back!",
"device": "YOUR_DEVICE_ID",
"timestamp": "2025-06-01T10:30:00Z"
}Example — curl
curl -X POST https://wa.fujicon.id/api/webhook/set \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url":"https://your-app.com/webhook/whatsapp"}'Error Codes
| Code | Meaning |
|---|---|
| 200 | Success — request processed. |
| 400 | Bad request — required field missing or malformed body. |
| 401 | Unauthorized — invalid or missing API token. |
| 404 | Not found — device ID does not exist or is offline. |
| 500 | Internal server error — please retry or contact support. |
Migration from Wablas
WA Gateway is a drop-in replacement for Wablas. Only three changes are needed:
Change the base URL
Before (Wablas)
https://pati.wablas.com/After (WA Gateway)
https://wa.fujicon.id/api/Pass the device ID explicitly
In Wablas the device was embedded in the token. In WA Gateway it is explicit — add an X-Device-ID: YOUR_DEVICE_ID header (or device_id in the body).
Swap the auth token
Replace your Wablas token with a WA Gateway API key. The header format is identical: Authorization: Bearer YOUR_TOKEN.
All other request and response shapes are identical to Wablas. No further code changes are needed.