TUNGKAO API စာရွက်စာတမ်း
API · discord_notify

Discord အသိပေးချက်

သင့် သို့ ဖောက်သည်၏ Discord channel များသို့ စာပို့ — ဥပမာ အဖွဲ့အတွက် အော်ဒါသစ်

🕒 နောက်ဆုံးအပ်ဒိတ်: ထိုင်းစံတော်ချိန် (UTC+07:00) · ✅ ကုဒ်ဟောင်း ဆက်သုံးနိုင်

🤖 AI ဖြင့် ချိတ်ဆက်ကုဒ်ရေးခိုင်းရန်

ဤလင့်ခ်ကို AI ဖတ်ရန် ကူးပါ သို့မဟုတ် ခလုတ်နှိပ်ပါ — prompt ကူးပြီး AI ဖွင့်ပေးမည်

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

ဤလင့်ခ်သည် ဤ API ၏ အပ်ဒိတ်များကို JSON ဖြင့် ပြန်ပေးသည် (key မလို၊ မည်သည့် domain မှမဆို)။ admin စာမျက်နှာတွင် “အပ်ဒိတ်ကြေညာချက်” ဘောက်စ်အဖြစ်ပြပြီး last_updated ပြောင်းလျှင် “အသစ်” ပြပါ

ChatGPT ↗Claude ↗Gemini ↗Grok ↗

ကူး + ဖွင့်ရန်: AI ခလုတ်နှိပ်လျှင် prompt ကို အလိုအလျောက်ကူးပေးသည်၊ chat အကွက်လွတ်နေလျှင် paste လုပ်ပါ

🔑 သုံးရမည့် key

ကုန်သည်ပေါ်တယ် (API key) တွင် discord_notify key ဖန်တီး၍ request တိုင်းတွင် ဤ header ပို့ပါ — အခြား service ၏ key များ ဤနေရာတွင် အလုပ်မလုပ်

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 ဖွင့်/ပိတ် ခလုတ်နှင့် ပြောင်းချိန် + ဝက်ဘ်ဆိုက်တစ်ခု ဝန်ဆောင်မှုတစ်ခုလျှင် key ၁ ခု
  6. တိုးတက် ထိုင်းစံတော်ချိန် (UTC+07:00)
    API v1 ကိုအမြဲပိတ် (ထပ်ထည့်ရုံသာ) + X-Tungkao-Api-Version header + ၁၂ လကြိုတင်အသိပေး
  7. စာရွက်စာတမ်း ထိုင်းစံတော်ချိန် (UTC+07:00)
    API တစ်ခုချင်း docs စာမျက်နှာ + AI လင့်ခ် (ဘာသာ ၁၀)
  8. လုံခြုံရေး ထိုင်းစံတော်ချိန် (UTC+07:00)
    API key တစ်ခုချင်း domain အတည်ပြု (key 1 = site 1) — key ဟောင်းများ ဆက်သုံးနိုင်
  9. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    HMAC request လက်မှတ် (ရွေးချယ်) — မဖွင့်လျှင် ဘာမှမပြောင်း
  10. အသစ် ထိုင်းစံတော်ချိန် (UTC+07:00)
    Telegram နှင့် Discord အသိပေးချက် စတင်
  11. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    API key သက်တမ်း + သတိပေး + သက်တမ်းတိုး — key စာသားမပြောင်း
  12. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    service တိုင်းအတွက် test mode key (ပုံတူ၊ အခမဲ့)

✅ ကုဒ်ဟောင်း ဆက်သုံးနိုင်

🛡️ တည်ငြိမ်မှုကတိ: တစ်ကြိမ်ချိတ် အမြဲသုံး

🚦 စနစ်အခြေအနေ (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 credit ပြသရန် စည်းကမ်း

Powered by TUNGKAO