WAYAQR Code expired
WhatsApp disconnected
default untuk membalas pesan yang tidak cocok dengan keyword manapun. Rule ini hanya dijalankan sebagai fallback jika tidak ada rule lain yang match. Match type pada rule default akan diabaikan.
| Keyword | Match | Mode | Response / Script | Status | Actions |
|---|---|---|---|---|---|
{{ r.keyword }} |
{{ r.matchType }} | {{ r.mode === 'script' ? 'ā” Script' : 'š¬ Message' }} | {{ r.mode === 'script' ? (r.script || '').substring(0, 60) + '...' : r.response }} {{ r.mediaUrls.length }} | {{ r.enabled ? 'ON' : 'OFF' }} | |
| No rules yet | |||||
async function(client, args, axios, sheets) {
// your code here
}
| Parameter | Tipe | Deskripsi |
|---|---|---|
client | Object | Object untuk mengirim pesan ke chat |
args | Array | Argument yang dikirim user setelah keyword, otomatis di-parse |
axios | Function | HTTP client untuk memanggil API eksternal |
sheets | Object / null | Google Sheets helper (null jika service-account.json tidak ada) |
| Method | Deskripsi | Contoh |
|---|---|---|
client.send(text) |
Kirim pesan ke chat yang sedang aktif (pengirim) | client.send("Halo!") |
return "text" |
Return string untuk langsung reply ke pengirim | return `Halo ${args[0]}!` |
Teks setelah keyword otomatis dipecah berdasarkan spasi. Gunakan tanda kutip ("..." atau '...') untuk argument yang mengandung spasi.
| Pesan Masuk | Keyword | Hasil args |
|---|---|---|
!sapa Budi |
!sapa |
["Budi"] ā args[0] = "Budi" |
!kirim Budi halo bro |
!kirim |
["Budi", "halo", "bro"] |
!kirim Budi "halo bro" |
!kirim |
["Budi", "halo bro"] ā kutipan menjaga spasi |
!cek |
!cek |
[] ā kosong jika tidak ada argument |
const nama = args[0] || "teman";
const pesan = args[1] || "apa kabar?";
return `Halo ${nama}, ${pesan}`;
service-account.json sudah ada di root project, dan spreadsheet sudah di-share ke email service account tersebut.
| Method | Deskripsi |
|---|---|
sheets.readSheet(spreadsheetId, sheetName, numColumns) |
Baca data dari sheet. Return array of rows (header/baris pertama otomatis di-skip). numColumns opsional untuk membatasi jumlah kolom dari A. |
sheets.writeSheet(spreadsheetId, range, values) |
Tulis/overwrite data ke range tertentu. values adalah array 2D [[row1col1, row1col2], [row2col1, ...]] |
sheets.appendSheet(spreadsheetId, range, values) |
Tambah baris baru ke akhir sheet. values sama seperti writeSheet. |
// Keyword: !stok
// Spreadsheet ID dari URL: https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit
const SHEET_ID = "1aBcDeFgHiJkLmNoPqRsTuVwXyZ";
const rows = await sheets.readSheet(SHEET_ID, "Sheet1", 3);
// rows = [["Baju", "50", "Rp100.000"], ["Celana", "30", "Rp150.000"], ...]
if (!rows.length) return "Data stok kosong.";
let result = "š¦ *Daftar Stok:*\n";
for (const [nama, qty, harga] of rows) {
result += `\n⢠${nama} ā Qty: ${qty}, Harga: ${harga}`;
}
return result;
// Keyword: !tambah (Match: startsWith)
// Pesan: !tambah Baju 50 Rp100.000
const SHEET_ID = "1aBcDeFgHiJkLmNoPqRsTuVwXyZ";
if (args.length < 3) return "Format: !tambah [nama] [qty] [harga]";
await sheets.appendSheet(SHEET_ID, "Sheet1!A:C", [
[args[0], args[1], args[2]]
]);
return `ā
Berhasil ditambahkan: ${args[0]} (${args[1]}x) @ ${args[2]}`;
// Update cell B2 dengan value baru
const SHEET_ID = "1aBcDeFgHiJkLmNoPqRsTuVwXyZ";
await sheets.writeSheet(SHEET_ID, "Sheet1!B2", [["100"]]);
return "ā
Stok berhasil diupdate!";
Gunakan axios untuk memanggil API eksternal (REST API, webhook, dll).
| Method | Deskripsi |
|---|---|
axios.get(url, config?) | HTTP GET request |
axios.post(url, data?, config?) | HTTP POST request |
axios.put(url, data?, config?) | HTTP PUT request |
axios.delete(url, config?) | HTTP DELETE request |
// Keyword: !cuaca (Match: startsWith)
// Pesan: !cuaca Jakarta
const kota = args[0] || "Jakarta";
const { data } = await axios.get(
`https://api.weatherapi.com/v1/current.json?key=YOUR_KEY&q=${kota}`
);
return `š¤ Cuaca ${kota}: ${data.current.condition.text}, ${data.current.temp_c}°C`;
// Kirim notifikasi ke webhook (Discord, Slack, dll)
await axios.post("https://hooks.slack.com/services/xxx", {
text: `Pesan baru dari WA: ${args.join(" ")}`
});
return "ā
Notifikasi terkirim!";
| Pola | Contoh Code |
|---|---|
| Validasi argument wajib | if (!args[0]) return "ā Masukkan nama! Contoh: !sapa Budi"; |
| Default value | const nama = args[0] || "teman"; |
| Gabung semua argument jadi satu teks | const pesan = args.join(" "); |
| Cek jumlah argument | if (args.length < 2) return "Format: !cmd [arg1] [arg2]"; |
| Kirim multi-line response | return `Baris 1\nBaris 2\nBaris 3`; |
| Kirim pesan bold/italic (WhatsApp formatting) | return `*Bold* _Italic_ ~Strikethrough~ \`\`\`Code\`\`\``; |
| Tanggal/waktu saat ini | const now = new Date().toLocaleString("id-ID", { timeZone: "Asia/Jakarta" }); |
| Random response | const arr = ["Halo!", "Hai!", "Hey!"]; return arr[Math.floor(Math.random() * arr.length)]; |
| Command | Mode | Reply / Script | Status | Actions |
|---|---|---|---|---|
{{ c.command }} |
{{ c.mode === 'script' ? 'ā” Script' : 'š¬ Message' }} | {{ c.mode === 'script' ? (c.script || '').substring(0, 60) + '...' : c.replyMessage }} {{ c.mediaUrls.length }} | {{ c.enabled ? 'ON' : 'OFF' }} | |
| No commands yet | ||||
command, mode, replyMessage, script, mediaUrls, enabled.X-API-Key.
{{ apiKeyValue || 'Loading...' }}
Selalu mengembalikan seluruh command. Query/filter tidak digunakan.
curl {{ baseUrl }}/api/quick-commands \
-H "X-API-Key: {{ apiKeyValue }}"
:id adalah ID command dari response GET.
curl -X PUT {{ baseUrl }}/api/quick-commands/COMMAND_ID \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '{
"command": "!halo",
"mode": "message",
"replyMessage": "Halo juga!",
"mediaUrls": [],
"enabled": true
}'
Replace seluruh daftar sekaligus. Body harus array JSON.
curl -X PUT {{ baseUrl }}/api/quick-commands \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '[
{
"id": "COMMAND_ID",
"command": "!halo",
"mode": "message",
"replyMessage": "Halo!",
"mediaUrls": [],
"enabled": true
}
]'
| Field | Type | Keterangan |
|---|---|---|
id | string | ID unik; otomatis dibuat jika kosong saat bulk PUT. |
command | string | Nama command. Prefix ! otomatis ditambahkan. |
mode | string | message atau script. |
replyMessage | string | Balasan untuk mode message. |
script | string | JavaScript untuk mode script. |
mediaUrls | array | Daftar URL attachment. |
enabled | boolean | Status aktif command. |
| # | Name | Script Preview | Status | Actions |
|---|---|---|---|---|
| {{ idx + 1 }} | {{ h.name }} | {{ (h.script || '').substring(0, 80) }}{{ (h.script||'').length > 80 ? '...' : '' }} |
{{ h.enabled ? 'ON' : 'OFF' }} | |
| No hooks yet. Add one to run custom code on every message. | ||||
{{ simResult.returned }}{{ s.to }}: {{ s.text }}
async function(client, msg, axios)msg.body ā message textmsg.from / msg.to ā sender / recipient chat IDmsg.fromMe ā boolean, true if you sent itmsg.chatId ā the chat where message was sentmsg.type ā message type (chat, image, etc.)client.send(text) ā reply to the same chatclient.sendTo(chatId, text) ā send to any chatreturn "text" ā shorthand to reply to the chat| Time | Hook | Status | Dir | Message | ms |
|---|---|---|---|---|---|
| {{ formatLogTime(log.ts) }} | {{ log.hookName }} | OK ERR replied | {{ log.fromMe ? 'ā OUT' : 'ā IN' }} | {{ log.msgBody }} | {{ log.duration }}ms |
| No logs yet. Send a message to trigger hooks. | |||||
async function(client, args, axios) ā return a string to reply, or use client.send(msg).!ping hello "dear friend" ā args = ["hello", "dear friend"]
!infoasync function(client, args, axios) ā return a string to reply, or use client.send(msg).
async function(client, msg, axios) ā client.send(text) to reply, client.sendTo(chatId, text) to send anywhere, or return "text" to auto-reply.
Selected recipients ({{ selectedChatIds.length }}):
{{ apiExLang==='curl'?apiExampleCurl:apiExLang==='fetch'?apiExampleJS:apiExLang==='axios'?apiExampleAxios:apiExLang==='dartdio'?apiExampleDartDio:apiExampleDartHttp }}
{{ chatId }}
Recipients ({{ (catData.assignments[catApiCat] || []).length }}):
{{ catApiTab==='curl'?catApiCurl:catApiTab==='fetch'?catApiFetch:catApiTab==='axios'?catApiAxios:catApiTab==='dartdio'?catApiDartDio:catApiDartHttp }}
Apakah Anda yakin ingin menghapus sesi WhatsApp?
/api/send-message are queued with a 5s delay between each.
| # | Ref ID | Recipient | Message | Status | Created | Sent | |
|---|---|---|---|---|---|---|---|
| {{ idx + 1 }} | {{ q.reference_id.length > 12 ? q.reference_id.substring(0,12)+'ā¦' : q.reference_id }}ā |
{{ q.number }} |
{{ (q.message || '').substring(0, 80) }} | Pending Sending Sent Failed | {{ formatLogTime(q.createdAt) }} | {{ q.sentAt ? formatLogTime(q.sentAt) : '-' }} | |
| Queue is empty. Messages sent via API will appear here. | |||||||
{{ queueDetail.id }}
{{ queueDetail.message }}
{{ JSON.stringify(queueDetail.request.headers, null, 2) }}
{{ JSON.stringify(queueDetail.request.body, null, 2) }}
Check the delivery status of a queued message by its queue ID or reference_id.
GET /api/message-status/:idThe :id param can be the queue ID (UUID) returned by send-message, or your custom reference_id.
curl {{ baseUrl }}/api/message-status/YOUR_REFERENCE_ID \
-H "X-API-Key: YOUR_API_KEY"
fetch("{{ baseUrl }}/api/message-status/YOUR_REFERENCE_ID", {
headers: { "X-API-Key": "YOUR_API_KEY" }
}).then(r => r.json()).then(console.log);
{
"id": "uuid-queue-id",
"reference_id": "your-custom-ref",
"number": "6282146727409",
"chatId": "6282146727409@c.us",
"message": "Hello!",
"status": "sent", // pending | sending | sent | failed
"error": null,
"createdAt": 1709654400000,
"sentAt": 1709654405000
}
"reference_id" when calling /api/send-message to tag messages with your own ID for easy tracking.
msg, axios
msg Object Reference{
id: "uuid-queue-id",
reference_id: "your-custom-ref", // or null
number: "6282146727409",
chatId: "6282146727409@c.us",
message: "Hello!",
status: "sent", // "sent" or "failed"
error: null, // error message if failed
createdAt: 1709654400000,
sentAt: 1709654405000 // null if failed
}
/api/* endpoints are logged here.
| # | Method | URL | Status | Time | IP | Date | |
|---|---|---|---|---|---|---|---|
| {{ idx + 1 }} | {{ l.method }} | {{ l.url }} | {{ l.statusCode }} | {{ l.duration }}ms | {{ l.ip }} | {{ formatLogTime(l.createdAt) }} | |
| No requests logged yet. | |||||||
{{ netDetail.url }}
{{ netDetail.statusCode }}
{{ JSON.stringify(netDetail.reqHeaders, null, 2) }}
{{ typeof netDetail.reqBody === 'object' ? JSON.stringify(netDetail.reqBody, null, 2) : netDetail.reqBody }}
{{ typeof netDetail.resBody === 'object' ? JSON.stringify(netDetail.resBody, null, 2) : (netDetail.resBody || '(empty)') }}
Download all your settings as a JSON file: auto-reply rules, commands, hooks, categories, pinned chats, contact names, and main number.
Upload a previously downloaded backup JSON file to restore all settings. This will overwrite existing data.
ā ļø Note: API key, password, and WhatsApp session are not included for security.
| Name | ID | Status | PID | CPU | Memory | Uptime | Restarts | Actions |
|---|---|---|---|---|---|---|---|---|
| {{ proc.name }} | {{ proc.pmId }} | {{ proc.status }} | {{ proc.pid || 'ā' }} | {{ Number(proc.cpu || 0).toFixed(1) }}% | {{ formatPm2Memory(proc.memory) }} | {{ formatPm2Duration(proc.uptimeMs) }} | {{ proc.restarts }} |
|
| No PM2 processes found. | ||||||||
| Loading PM2 processes... | ||||||||
| Type | Mode | Schedule | Content | Target | Last Run | Status | Actions |
|---|---|---|---|---|---|---|---|
| {{ t.type === 'status' ? 'š¢ Status' : 'š¬ Message' }} | {{ t.mode }} | ā {{ t.scheduledAt }} Every day {{ t.dailyTime }} {{ ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][t.weeklyDay] }} {{ t.weeklyTime }} | {{ (t.message || '').substring(0, 40) }}{{ (t.message||'').length > 40 ? '...' : '' }} {{ t.mediaUrls.length }} | {{ t.type==='status' ? 'ā' : (t.targetNumber || 'ā') }} | {{ t.lastRunAt ? new Date(t.lastRunAt).toLocaleString('id-ID') : 'ā' }} | {{ t.enabled ? 'ON' : 'OFF' }} | |
| No scheduled tasks yet | |||||||
{{ schedLogTask.log || 'No logs yet' }}
"main" as number in API calls to auto-resolve to this number.* to allow all. Otherwise one number per line (e.g. 6282146727409). Numbers not listed will be rejected.Base URL: {{ baseUrl }}
Authentication: Authorization: Bearer <JWT> · Content-Type: application/json
GET {{ baseUrl }}/api/commands -> list semua command
POST {{ baseUrl }}/api/commands -> buat command baru
PUT {{ baseUrl }}/api/commands/:id -> update command by id
PUT {{ baseUrl }}/api/commands -> replace semua command (array)
DELETE {{ baseUrl }}/api/commands/:id -> hapus command by id
PATCH {{ baseUrl }}/api/commands/:id/toggle -> toggle enabled/disabled
| Field | Tipe | Wajib | Deskripsi |
|---|---|---|---|
command | string | Ya | Trigger command, otomatis diawali ! (mis. !halo) |
replyMessage | string | Tidak | Pesan balasan statis (dipakai saat mode:"message") |
mode | "message" | "script" | Tidak | Default "message". "script" = jalankan kode JavaScript |
script | string | Tidak | Kode JavaScript (AsyncFunction body), dipakai saat mode:"script" |
mediaUrls | string[] | Tidak | Daftar URL gambar/file untuk dikirim beserta pesan |
enabled | boolean | Tidak | Default true. false = command nonaktif |
"script"Saat mode:"script", field script dijalankan sebagai AsyncFunction. Variabel yang tersedia:
| Variabel | Deskripsi |
|---|---|
client | WhatsApp client. client.send(text) untuk balas ke chat yang sama |
args | Array argumen dari pesan (mis. !halo John → args = ["John"]) |
axios | HTTP client untuk request eksternal |
sheets | Google Sheets helper (jika service-account.json ada) |
console | Console (output ke log server) |
Return string untuk auto-reply, atau panggil client.send(...) manual.
curl -X POST {{ baseUrl }}/api/commands \\
-H "Authorization: Bearer YOUR_JWT" \\
-H "Content-Type: application/json" \\
-d '{
"command": "!halo",
"replyMessage": "Halo juga!",
"mode": "message",
"mediaUrls": [],
"enabled": true
}'
curl -X POST {{ baseUrl }}/api/commands \\
-H "Authorization: Bearer YOUR_JWT" \\
-H "Content-Type: application/json" \\
-d '{
"command": "!cuaca",
"mode": "script",
"script": "const kota = args[0] || \"Jakarta\"; const res = await axios.get(`https://wttr.in/${kota}?format=3`); return res.data;",
"mediaUrls": ["https://example.com/weather.jpg"],
"enabled": true
}'
curl -X PUT {{ baseUrl }}/api/commands/CMD_ID \\
-H "Authorization: Bearer YOUR_JWT" \\
-H "Content-Type: application/json" \\
-d '{"replyMessage": "Updated!", "enabled": false}'
curl -X PATCH {{ baseUrl }}/api/commands/CMD_ID/toggle \\
-H "Authorization: Bearer YOUR_JWT"
Authentication: Authorization: Bearer <JWT> · Content-Type: application/json
Quick Reply di UI = endpoint /api/autoreply. Auto-reply memicu balasan otomatis berdasarkan keyword pada pesan masuk.
GET {{ baseUrl }}/api/autoreply -> list semua rule
POST {{ baseUrl }}/api/autoreply -> buat rule baru
PUT {{ baseUrl }}/api/autoreply/:id -> update rule by id
DELETE {{ baseUrl }}/api/autoreply/:id -> hapus rule by id
PATCH {{ baseUrl }}/api/autoreply/:id/toggle -> toggle enabled/disabled
POST {{ baseUrl }}/api/autoreply/:id/move-to-command -> konversi rule menjadi Command
| Field | Tipe | Wajib | Deskripsi |
|---|---|---|---|
keyword | string | Ya | Kata pemicu pada pesan masuk (mis. hello atau !ping) |
matchType | "equals" | "contains" | "startsWith" | Tidak | Default "contains". Cara mencocokkan keyword |
response | string | Tidak | Pesan balasan statis (dipakai saat mode:"message") |
mode | "message" | "script" | Tidak | Default "message". "script" = jalankan kode JavaScript |
script | string | Tidak | Kode JavaScript (AsyncFunction body), dipakai saat mode:"script" |
mediaUrls | string[] | Tidak | Daftar URL gambar/file untuk dikirim beserta balasan |
enabled | boolean | Tidak | Default true. false = rule nonaktif |
"script"Sama seperti Commands. Variabel: client, args, axios, sheets, console. args di-parse dari pesan setelah keyword.
curl -X POST {{ baseUrl }}/api/autoreply \\
-H "Authorization: Bearer YOUR_JWT" \\
-H "Content-Type: application/json" \\
-d '{
"keyword": "hello",
"matchType": "contains",
"response": "Halo! Apa kabar?",
"mode": "message",
"mediaUrls": [],
"enabled": true
}'
curl -X POST {{ baseUrl }}/api/autoreply \\
-H "Authorization: Bearer YOUR_JWT" \\
-H "Content-Type: application/json" \\
-d '{
"keyword": "!jam",
"matchType": "equals",
"mode": "script",
"script": "const now = new Date().toLocaleTimeString(\"id-ID\"); return `Sekarang jam ${now}`;",
"mediaUrls": ["https://example.com/clock.png"],
"enabled": true
}'
"equals" -> pesan sama persis dengan keyword "contains" -> pesan mengandung keyword (default) "startsWith" -> pesan diawali dengan keyword
curl -X POST {{ baseUrl }}/api/autoreply/RULE_ID/move-to-command \\
-H "Authorization: Bearer YOUR_JWT"
# Rule "hello" akan menjadi Command "!hello" dengan replyMessage/script yang sama
curl -X POST {{ baseUrl }}/api/send-message \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '{"number": "6282146727409", "message": "Hello!"}'
fetch("{{ baseUrl }}/api/send-message", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "{{ apiKeyValue }}"
},
body: JSON.stringify({ number: "6282146727409", message: "Hello!" })
}).then(r => r.json()).then(console.log);
const axios = require('axios');
axios.post('{{ baseUrl }}/api/send-message', {
number: '6282146727409',
message: 'Hello!'
}, {
headers: { 'X-API-Key': '{{ apiKeyValue }}' }
}).then(res => console.log(res.data));
import 'package:dio/dio.dart';
final dio = Dio();
final response = await dio.post('{{ baseUrl }}/api/send-message',
data: {'number': '6282146727409', 'message': 'Hello!'},
options: Options(headers: {'X-API-Key': '{{ apiKeyValue }}'}),
);
print(response.data);
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.post(
Uri.parse('{{ baseUrl }}/api/send-message'),
headers: {'Content-Type': 'application/json', 'X-API-Key': '{{ apiKeyValue }}'},
body: jsonEncode({'number': '6282146727409', 'message': 'Hello!'}),
);
print(response.body);
curl -X POST {{ baseUrl }}/api/send-message \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '{
"recipients": ["6282146727409", "628xxx"],
"message": "Hello everyone!"
}'
fetch("{{ baseUrl }}/api/send-message", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "{{ apiKeyValue }}"
},
body: JSON.stringify({
recipients: ["6282146727409", "628xxx"],
message: "Hello everyone!"
})
}).then(r => r.json()).then(console.log);
const axios = require('axios');
axios.post('{{ baseUrl }}/api/send-message', {
recipients: ['6282146727409', '628xxx'],
message: 'Hello everyone!'
}, {
headers: { 'X-API-Key': '{{ apiKeyValue }}' }
}).then(res => console.log(res.data));
import 'package:dio/dio.dart';
final dio = Dio();
final response = await dio.post('{{ baseUrl }}/api/send-message',
data: {
'recipients': ['6282146727409', '628xxx'],
'message': 'Hello everyone!'
},
options: Options(headers: {'X-API-Key': '{{ apiKeyValue }}'}),
);
print(response.data);
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.post(
Uri.parse('{{ baseUrl }}/api/send-message'),
headers: {'Content-Type': 'application/json', 'X-API-Key': '{{ apiKeyValue }}'},
body: jsonEncode({
'recipients': ['6282146727409', '628xxx'],
'message': 'Hello everyone!'
}),
);
print(response.body);
curl -X POST {{ baseUrl }}/api/send-message \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '{
"recipients": ["120363xxx@g.us"],
"message": "Hello group!"
}'
fetch("{{ baseUrl }}/api/send-message", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "{{ apiKeyValue }}"
},
body: JSON.stringify({
recipients: ["120363xxx@g.us"],
message: "Hello group!"
})
}).then(r => r.json()).then(console.log);
const axios = require('axios');
axios.post('{{ baseUrl }}/api/send-message', {
recipients: ['120363xxx@g.us'],
message: 'Hello group!'
}, {
headers: { 'X-API-Key': '{{ apiKeyValue }}' }
}).then(res => console.log(res.data));
import 'package:dio/dio.dart';
final dio = Dio();
final response = await dio.post('{{ baseUrl }}/api/send-message',
data: {
'recipients': ['120363xxx@g.us'],
'message': 'Hello group!'
},
options: Options(headers: {'X-API-Key': '{{ apiKeyValue }}'}),
);
print(response.data);
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.post(
Uri.parse('{{ baseUrl }}/api/send-message'),
headers: {'Content-Type': 'application/json', 'X-API-Key': '{{ apiKeyValue }}'},
body: jsonEncode({
'recipients': ['120363xxx@g.us'],
'message': 'Hello group!'
}),
);
print(response.body);
curl -X POST {{ baseUrl }}/api/send-message \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '{
"recipients": [
"6282146727409",
"628xxx",
"120363xxx@g.us",
"120363yyy@g.us"
],
"message": "Hello!"
}'
fetch("{{ baseUrl }}/api/send-message", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "{{ apiKeyValue }}"
},
body: JSON.stringify({
recipients: [
"6282146727409",
"628xxx",
"120363xxx@g.us",
"120363yyy@g.us"
],
message: "Hello!"
})
}).then(r => r.json()).then(console.log);
const axios = require('axios');
axios.post('{{ baseUrl }}/api/send-message', {
recipients: [
'6282146727409',
'628xxx',
'120363xxx@g.us',
'120363yyy@g.us'
],
message: 'Hello!'
}, {
headers: { 'X-API-Key': '{{ apiKeyValue }}' }
}).then(res => console.log(res.data));
import 'package:dio/dio.dart';
final dio = Dio();
final response = await dio.post('{{ baseUrl }}/api/send-message',
data: {
'recipients': [
'6282146727409',
'628xxx',
'120363xxx@g.us',
'120363yyy@g.us'
],
'message': 'Hello!'
},
options: Options(headers: {'X-API-Key': '{{ apiKeyValue }}'}),
);
print(response.data);
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.post(
Uri.parse('{{ baseUrl }}/api/send-message'),
headers: {'Content-Type': 'application/json', 'X-API-Key': '{{ apiKeyValue }}'},
body: jsonEncode({
'recipients': [
'6282146727409',
'628xxx',
'120363xxx@g.us',
'120363yyy@g.us'
],
'message': 'Hello!'
}),
);
print(response.body);
curl -X POST {{ baseUrl }}/api/send-message \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '{"number": "main", "message": "Hello!"}'
fetch("{{ baseUrl }}/api/send-message", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "{{ apiKeyValue }}"
},
body: JSON.stringify({ number: "main", message: "Hello!" })
}).then(r => r.json()).then(console.log);
const axios = require('axios');
axios.post('{{ baseUrl }}/api/send-message', {
number: 'main',
message: 'Hello!'
}, {
headers: { 'X-API-Key': '{{ apiKeyValue }}' }
}).then(res => console.log(res.data));
import 'package:dio/dio.dart';
final dio = Dio();
final response = await dio.post('{{ baseUrl }}/api/send-message',
data: {'number': 'main', 'message': 'Hello!'},
options: Options(headers: {'X-API-Key': '{{ apiKeyValue }}'}),
);
print(response.data);
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.post(
Uri.parse('{{ baseUrl }}/api/send-message'),
headers: {'Content-Type': 'application/json', 'X-API-Key': '{{ apiKeyValue }}'},
body: jsonEncode({'number': 'main', 'message': 'Hello!'}),
);
print(response.body);
curl -X POST {{ baseUrl }}/api/send-message \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '{
"number": "6282146727409",
"message": "Check this image!",
"media": { "url": "https://example.com/photo.jpg" }
}'
fetch("{{ baseUrl }}/api/send-message", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "{{ apiKeyValue }}"
},
body: JSON.stringify({
number: "6282146727409",
message: "Check this image!",
media: { url: "https://example.com/photo.jpg" }
})
}).then(r => r.json()).then(console.log);
const axios = require('axios');
axios.post('{{ baseUrl }}/api/send-message', {
number: '6282146727409',
message: 'Check this image!',
media: { url: 'https://example.com/photo.jpg' }
}, {
headers: { 'X-API-Key': '{{ apiKeyValue }}' }
}).then(res => console.log(res.data));
import 'package:dio/dio.dart';
final dio = Dio();
final response = await dio.post('{{ baseUrl }}/api/send-message',
data: {
'number': '6282146727409',
'message': 'Check this image!',
'media': { 'url': 'https://example.com/photo.jpg' }
},
options: Options(headers: {'X-API-Key': '{{ apiKeyValue }}'}),
);
print(response.data);
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.post(
Uri.parse('{{ baseUrl }}/api/send-message'),
headers: {'Content-Type': 'application/json', 'X-API-Key': '{{ apiKeyValue }}'},
body: jsonEncode({
'number': '6282146727409',
'message': 'Check this image!',
'media': { 'url': 'https://example.com/photo.jpg' }
}),
);
print(response.body);
curl -X POST {{ baseUrl }}/api/send-message \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '{
"number": "6282146727409",
"message": "Here is the document",
"media": {
"data": "BASE64_ENCODED_DATA",
"mimetype": "application/pdf",
"filename": "document.pdf"
}
}'
fetch("{{ baseUrl }}/api/send-message", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "{{ apiKeyValue }}"
},
body: JSON.stringify({
number: "6282146727409",
message: "Here is the document",
media: {
data: "BASE64_ENCODED_DATA",
mimetype: "application/pdf",
filename: "document.pdf"
}
})
}).then(r => r.json()).then(console.log);
const axios = require('axios');
const fs = require('fs');
const fileData = fs.readFileSync('document.pdf').toString('base64');
axios.post('{{ baseUrl }}/api/send-message', {
number: '6282146727409',
message: 'Here is the document',
media: {
data: fileData,
mimetype: 'application/pdf',
filename: 'document.pdf'
}
}, {
headers: { 'X-API-Key': '{{ apiKeyValue }}' }
}).then(res => console.log(res.data));
import 'dart:convert';
import 'dart:io';
import 'package:dio/dio.dart';
final dio = Dio();
final bytes = await File('document.pdf').readAsBytes();
final response = await dio.post('{{ baseUrl }}/api/send-message',
data: {
'number': '6282146727409',
'message': 'Here is the document',
'media': {
'data': base64Encode(bytes),
'mimetype': 'application/pdf',
'filename': 'document.pdf'
}
},
options: Options(headers: {'X-API-Key': '{{ apiKeyValue }}'}),
);
print(response.data);
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
final bytes = await File('document.pdf').readAsBytes();
final response = await http.post(
Uri.parse('{{ baseUrl }}/api/send-message'),
headers: {'Content-Type': 'application/json', 'X-API-Key': '{{ apiKeyValue }}'},
body: jsonEncode({
'number': '6282146727409',
'message': 'Here is the document',
'media': {
'data': base64Encode(bytes),
'mimetype': 'application/pdf',
'filename': 'document.pdf'
}
}),
);
print(response.body);
curl -X POST {{ baseUrl }}/api/send-message \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '{
"number": "6282146727409",
"media": { "url": "https://example.com/photo.jpg" }
}'
// Same as above examples, just omit the "message" field. // Only "number" (or "recipients") + "media" is required.
"number" for a single recipient or "recipients" array for multiple."main" as number to send to your configured Main Number ({{ mainNumber }}).+ (e.g. 6282146727409).@g.us (e.g. 120363xxx@g.us)."recipients" array."media": {"url": "..."} to send from a URL, or "media": {"data": "BASE64", "mimetype": "...", "filename": "..."} for base64."message" is optional when sending media ā it becomes the caption. You can send media without text."message" or "media" (or both) must be provided."reference_id" to tag messages with your own tracking ID.Check the delivery status of a queued message by its queue ID or your custom reference_id.
GET /api/message-status/:idcurl -X POST {{ baseUrl }}/api/send-message \
-H "Content-Type: application/json" \
-H "X-API-Key: {{ apiKeyValue }}" \
-d '{
"number": "6282146727409",
"message": "Hello!",
"reference_id": "order-12345"
}'
fetch("{{ baseUrl }}/api/send-message", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "{{ apiKeyValue }}"
},
body: JSON.stringify({
number: "6282146727409",
message: "Hello!",
reference_id: "order-12345"
})
}).then(r => r.json()).then(console.log);
const axios = require('axios');
axios.post('{{ baseUrl }}/api/send-message', {
number: '6282146727409',
message: 'Hello!',
reference_id: 'order-12345'
}, {
headers: { 'X-API-Key': '{{ apiKeyValue }}' }
}).then(res => console.log(res.data));
import 'package:dio/dio.dart';
final dio = Dio();
final response = await dio.post('{{ baseUrl }}/api/send-message',
data: {
'number': '6282146727409',
'message': 'Hello!',
'reference_id': 'order-12345'
},
options: Options(headers: {'X-API-Key': '{{ apiKeyValue }}'}),
);
print(response.data);
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.post(
Uri.parse('{{ baseUrl }}/api/send-message'),
headers: {'Content-Type': 'application/json', 'X-API-Key': '{{ apiKeyValue }}'},
body: jsonEncode({
'number': '6282146727409',
'message': 'Hello!',
'reference_id': 'order-12345'
}),
);
print(response.body);
curl {{ baseUrl }}/api/message-status/order-12345 \
-H "X-API-Key: {{ apiKeyValue }}"
fetch("{{ baseUrl }}/api/message-status/order-12345", {
headers: { "X-API-Key": "{{ apiKeyValue }}" }
}).then(r => r.json()).then(console.log);
const axios = require('axios');
axios.get('{{ baseUrl }}/api/message-status/order-12345', {
headers: { 'X-API-Key': '{{ apiKeyValue }}' }
}).then(res => console.log(res.data));
import 'package:dio/dio.dart';
final dio = Dio();
final response = await dio.get('{{ baseUrl }}/api/message-status/order-12345',
options: Options(headers: {'X-API-Key': '{{ apiKeyValue }}'}),
);
print(response.data);
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.get(
Uri.parse('{{ baseUrl }}/api/message-status/order-12345'),
headers: {'X-API-Key': '{{ apiKeyValue }}'},
);
print(jsonDecode(response.body));
{
"id": "uuid-queue-id",
"reference_id": "order-12345",
"number": "6282146727409",
"chatId": "6282146727409@c.us",
"message": "Hello!",
"status": "sent", // pending | sending | sent | failed
"error": null,
"createdAt": 1709654400000,
"sentAt": 1709654405000
}
!todo <task> [link] [desc]
!todo ā list pending Ā·
!todo Fix login bug ā title only Ā·
!todo "Fix login" https://t.co/x Reset password flow ā title + link + desc