Register a Discord channel
Tình huống: You want new orders posted in #orders
POST /v1/discord/webhooks
{
"ref": "orders-room",
"url": "https://discord.com/api/webhooks/123/abc…"
}
➡️ Name it once with ref and use it forever
discord_notifyGửi tin vào kênh Discord của bạn hoặc khách — vd báo đơn mới cho đội.
🕒 Cập nhật lần cuối: Giờ Thái Lan (UTC+07:00) · ✅ Mã cũ vẫn chạy, không cần sửa
Sao chép liên kết này cho AI đọc (toàn bộ API dạng Markdown) hoặc bấm nút: lời nhắc được sao chép và AI được mở
https://app.tungkao.com/docs/api/discord_notify.md?lang=vihttps://api.tungkao.com/changelog/discord_notify.jsonLiên kết này trả về các cập nhật của API dưới dạng JSON (không cần key, mọi nguồn). Hãy hiển thị trong trang quản trị như hộp “Thông báo cập nhật” và gắn “Mới” khi last_updated thay đổi
Sao chép + mở: Bấm nút AI sẽ tự sao chép lời nhắc — nếu ô chat trống, chỉ cần dán
Tạo key discord_notify trong cổng bán hàng (API key) và gửi header này với mọi yêu cầu — key của dịch vụ khác không dùng được ở đây
Authorization: Bearer $TUNGKAO_KEY/v1/discord/webhookscurl -X POST https://api.tungkao.com/v1/discord/webhooks \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"ref":"orders-room","url":"https://discord.com/api/webhooks/123/abc…"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/discord/webhooks", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"ref": "orders-room",
"url": "https://discord.com/api/webhooks/123/abc…"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/discord/webhooks");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"ref" => "orders-room",
"url" => "https://discord.com/api/webhooks/123/abc…"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/discord/webhooks",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"ref": "orders-room",
"url": "https://discord.com/api/webhooks/123/abc…"
},
timeout=30,
)
print(r.json())/v1/discord/sendcurl -X POST https://api.tungkao.com/v1/discord/send \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"ref":"orders-room","text":"🛒 New order #1001 — 590 THB"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/discord/send", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"ref": "orders-room",
"text": "🛒 New order #1001 — 590 THB"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/discord/send");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"ref" => "orders-room",
"text" => "🛒 New order #1001 — 590 THB"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/discord/send",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"ref": "orders-room",
"text": "🛒 New order #1001 — 590 THB"
},
timeout=30,
)
print(r.json())Tình huống: You want new orders posted in #orders
POST /v1/discord/webhooks
{
"ref": "orders-room",
"url": "https://discord.com/api/webhooks/123/abc…"
}
➡️ Name it once with ref and use it forever
Tình huống: Order #1001 for 590 THB comes in
POST /v1/discord/send
{
"ref": "orders-room",
"text": "🛒 New order #1001 — 590 THB"
}
➡️ The message appears in the channel right away
Tình huống: You want the sender to show as “Shop Bot”
POST /v1/discord/send
{
"ref": "orders-room",
"text": "Daily sales: 12,400 THB",
"username": "Shop Bot"
}
➡️ The message shows Shop Bot as the sender
Tình huống: Notify both the admin and the stock channels
POST /v1/discord/send
{
"refs": [
"admin-room",
"stock-room"
],
"text": "Stock low: T-shirt size M"
}
➡️ Posted to every listed channel
Tình huống: You want to see which messages failed
GET /v1/discord/messages
➡️ Returns each message with its status
✅ Mã cũ vẫn chạy, không cần sửa
Kiểm tra API có bình thường không bất cứ lúc nào — không cần key
GET https://api.tungkao.com/status
curl https://api.tungkao.com/status{
"success": true,
"data": {
"status": "ok",
"services": [
{ "id": "slip_verify", "status": "ok", "routes": ["ok", "ok", "busy"] },
{ "id": "slip_deposit", "status": "ok", "routes": ["ok", "ok", "busy"] },
{ "id": "login", "status": "ok" },
{ "id": "telegram", "status": "ok" },
{ "id": "discord", "status": "ok" },
{ "id": "email", "status": "busy" },
{ "id": "crypto", "status": "ok" },
{ "id": "core", "status": "ok" }
],
"paused": [],
"updated_at": "2026-11-14T12:00:00.000Z"
}
}Powered by TUNGKAO