TUNGKAO ເອກະສານ API
API · discord_notify

ແຈ້ງເຕືອນທາງ Discord

ສົ່ງຂໍ້ຄວາມເຂົ້າຫ້ອງ Discord ຂອງທ່ານ ຫຼື ລູກຄ້າ ເຊັ່ນ ແຈ້ງອໍເດີໃໝ່ໃຫ້ທີມ

🕒 ອັບເດດລ່າສຸດ: ເວລາປະເທດໄທ (UTC+07:00) · ✅ ໂຄດເດີມໃຊ້ໄດ້ ບໍ່ຕ້ອງແກ້

🤖 ໃຫ້ AI ຂຽນໂຄດເຊື່ອມຕໍ່ໃຫ້

ສຳເນົາລິ້ງນີ້ໃຫ້ AI ອ່ານ ຫຼື ກົດປຸ່ມ ລະບົບຈະສຳເນົາຄຳສັ່ງ ແລະ ເປີດ AI ໃຫ້

https://app.tungkao.com/docs/api/discord_notify.md?lang=lo
https://api.tungkao.com/changelog/discord_notify.json

ລິ້ງນີ້ສົ່ງລາຍການອັບເດດຂອງ API ນີ້ເປັນ JSON (ບໍ່ຕ້ອງໃຊ້ key ເປີດໄດ້ທຸກໂດເມນ) ໃຫ້ໜ້າຫຼັງບ້ານສະແດງເປັນກ່ອງ “ປະກາດອັບເດດ” ແລະ ຂຶ້ນ “ໃໝ່” ເມື່ອ last_updated ປ່ຽນ

ChatGPT ↗Claude ↗Gemini ↗Grok ↗

ສຳເນົາ + ເປີດໃນ: ກົດປຸ່ມ AI ລະບົບຈະສຳເນົາຄຳສັ່ງໃຫ້ ຖ້າຊ່ອງແຊັດວ່າງ ໃຫ້ວາງໄດ້ເລີຍ

🔑 key ທີ່ໃຊ້

ສ້າງ key ບໍລິການ discord_notify ທີ່ໜ້າຮ້ານ (ເມນູ API key) ແລ້ວສົ່ງທຸກຄຳຂໍດ້ວຍ header ດ້ານລຸ່ມ — key ບໍລິການອື່ນໃຊ້ກັບ API ນີ້ບໍ່ໄດ້

Authorization: Bearer $TUNGKAO_KEY

📋 ຂັ້ນຕອນ

  1. Create a channel webhook in Discord (needs Manage Webhooks): desktop right-click the channel → Edit Channel → Integrations → Webhooks → New Webhook → name it → Copy Webhook URL (mobile: long-press the channel → Edit Channel).
  2. ref is your own name for the channel, e.g. orders-room (A-Z a-z 0-9 _ . : @ - up to 128 chars). One key can hold many channels, each with its own ref.
  3. Add a channel: POST /v1/discord/webhooks {ref, url} — url must start with https://discord.com/api/webhooks/…; it is stored encrypted and never returned. Posting the same ref again replaces that channel's link.
  4. Send: POST /v1/discord/send {ref, text} (up to 2000 chars; @everyone / @here are disabled automatically). Results are in data.results: sent / not_linked / failed.
  5. List channels: GET /v1/discord/recipients. Remove: DELETE /v1/discord/recipients/{ref}. If the webhook is deleted in Discord, the channel is paused and the undelivered message is refunded.
  6. Try it without code: TUNGKAO API key page → this key's card → “Set up notifications”: paste the webhook link, add the channel and send a test.
  7. Do not confuse this with the key's “Webhook URL” setting: that is your server address for receiving events from TUNGKAO, not a Discord channel link.

📡 ການເອີ້ນ API + ຕົວຢ່າງໂຄດ

POST/v1/discord/webhooks
curl -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…"}'
POST/v1/discord/send
curl -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"}'

📚 ຕົວຢ່າງການໃຊ້ງານ

ຕົວຢ່າງທີ 1

Register a Discord channel

ສະຖານະການ: 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

ຕົວຢ່າງທີ 2

Post a new order

ສະຖານະການ: 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

ຕົວຢ່າງທີ 3

Custom sender name

ສະຖານະການ: 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

ຕົວຢ່າງທີ 4

Post to several channels

ສະຖານະການ: 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

ຕົວຢ່າງທີ 5

Check sending history

ສະຖານະການ: You want to see which messages failed

ສົ່ງຄຳຂໍ
GET /v1/discord/messages

➡️ Returns each message with its status

📜 ປະຫວັດການອັບເດດຂອງ API ນີ້

  1. ເພີ່ມ ເວລາປະເທດໄທ (UTC+07:00)
    API update announcements by webhook: new api.update event (opt in per key on the key card; off by default)
  2. ເອກະສານ ເວລາປະເທດໄທ (UTC+07:00)
    Telegram / Discord notifications: step-by-step setup guide on the key card and in the docs (Telegram connect link, add a Discord channel webhook)
  3. ເພີ່ມ ເວລາປະເທດໄທ (UTC+07:00)
    error.user_message: ready-to-show text for end users on outages, no credits or key problems (white-label keys omit tungkao.com)
  4. ເພີ່ມ ເວລາປະເທດໄທ (UTC+07:00)
    GET /status: ສະຖານະ API ແຍກທຸກບໍລິການ (ບໍ່ຕ້ອງໃຊ້ key)
  5. ເພີ່ມ ເວລາປະເທດໄທ (UTC+07:00)
    ສະວິດເປີດ/ປິດ key ພ້ອມເວລາປ່ຽນສະຖານະ + 1 ເວັບ 1 key ຕໍ່ບໍລິການ
  6. ປັບປຸງ ເວລາປະເທດໄທ (UTC+07:00)
    ລັອກ API v1 ຖາວອນ (ເພີ່ມໄດ້ຢ່າງດຽວ) + header X-Tungkao-Api-Version + ແຈ້ງເລີກໃຊ້ລ່ວງໜ້າ 12 ເດືອນ
  7. ເອກະສານ ເວລາປະເທດໄທ (UTC+07:00)
    ໜ້າເອກະສານແຍກທຸກ API ພ້ອມລິ້ງໃຫ້ AI ຄົບ 10 ພາສາ
  8. ຄວາມປອດໄພ ເວລາປະເທດໄທ (UTC+07:00)
    ຢືນຢັນໂດເມນຕໍ່ API key (1 key = 1 ເວັບ) — key ເດີມໃຊ້ໄດ້ຄືເກົ່າ
  9. ເພີ່ມ ເວລາປະເທດໄທ (UTC+07:00)
    ເຊັນຄຳຂໍ (HMAC) ເປັນທາງເລືອກ — ບໍ່ເປີດກໍໃຊ້ໄດ້ຄືເກົ່າ
  10. ເປີດໃໝ່ ເວລາປະເທດໄທ (UTC+07:00)
    ເປີດບໍລິການແຈ້ງເຕືອນ Telegram ແລະ Discord
  11. ເພີ່ມ ເວລາປະເທດໄທ (UTC+07:00)
    ກຳນົດອາຍຸ API key + ແຈ້ງເຕືອນ + ຕໍ່ອາຍຸ key ເດີມໃຊ້ຕໍ່ໄດ້
  12. ເພີ່ມ ເວລາປະເທດໄທ (UTC+07:00)
    key ໂໝດ test (ຈຳລອງ ຟຣີ) ທຸກບໍລິການ

✅ ໂຄດເດີມໃຊ້ໄດ້ ບໍ່ຕ້ອງແກ້

🛡️ ສັນຍາຄວາມໝັ້ນຄົງ: ຂຽນເທື່ອດຽວ ໃຊ້ໄດ້ຕະຫຼອດ

🚦 ສະຖານະລະບົບ (GET /status)

ກວດໄດ້ຕະຫຼອດວ່າ API ປົກກະຕິບໍ່ ບໍ່ຕ້ອງໃຊ້ 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"
  }
}

🏷️ ເງື່ອນໄຂການໃສ່ເຄຣດິດ TUNGKAO

Powered by TUNGKAO