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

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

ສົ່ງຂໍ້ຄວາມຫາສະມາຊິກທາງ Telegram ຜ່ານບອດກາງຂອງ TUNGKAO ບໍ່ຕ້ອງສ້າງບອດເອງ ເຊັ່ນ ແຈ້ງຍອດເຂົ້າ ສະຖານະອໍເດີ OTP

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

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

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

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

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

ChatGPT ↗Claude ↗Gemini ↗Grok ↗

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

🔑 key ທີ່ໃຊ້

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

Authorization: Bearer $TUNGKAO_KEY

📋 ຂັ້ນຕອນ

  1. ref is your own name for a recipient (use your member id, e.g. member-1001): A-Z a-z 0-9 _ . : @ - up to 128 chars. Every call refers to the recipient by this ref.
  2. Add a recipient: your server calls POST /v1/telegram/link {ref} → gets data.url (a t.me/…?start=… link) → show it as a “Connect Telegram” button on the member's profile page (valid 30 minutes, single use; request again any time).
  3. The member opens the link → presses Start in Telegram → the bot confirms (Telegram does not let a bot message someone who never pressed Start, so this step cannot be skipped).
  4. Check the connection: GET /v1/telegram/recipients (status = active) — use it to switch your button to “Connected ✓”.
  5. Send: POST /v1/telegram/send with one ref or up to 100 refs; bold text (parse_mode: HTML) and a link button are supported. Per-recipient results are in data.results: sent / not_linked / failed.
  6. Remove a recipient: DELETE /v1/telegram/recipients/{ref}. Members can also send /stop to the bot. If a member blocks the bot, that recipient is paused until they connect again.
  7. Try it without code: TUNGKAO API key page → this key's card → “Set up notifications” has a create-link button (with QR) and a send-test button.

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

POST/v1/telegram/link
curl -X POST https://api.tungkao.com/v1/telegram/link \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ref":"member-1001"}'
POST/v1/telegram/send
curl -X POST https://api.tungkao.com/v1/telegram/send \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ref":"member-1001","text":"<b>Payment received</b> 500 THB","parse_mode":"HTML","button":{"text":"View order","url":"https://yourshop.com/orders/1"}}'
GET/v1/telegram/messages
curl -X GET https://api.tungkao.com/v1/telegram/messages \
  -H "Authorization: Bearer $TUNGKAO_KEY"

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

ຕົວຢ່າງທີ 1

Let a member connect Telegram

ສະຖານະການ: Member member-1001 wants notifications on Telegram

ສົ່ງຄຳຂໍ
POST /v1/telegram/link
{
  "ref": "member-1001"
}
ຕົວຢ່າງຜົນຕອບກັບ
{
  "success": true,
  "data": {
    "url": "https://t.me/…?start=…"
  }
}

➡️ Give the member the link to tap (valid 30 minutes, once)

ຕົວຢ່າງທີ 2

Notify a payment

ສະຖານະການ: 500 THB arrived and you want to notify the member

ສົ່ງຄຳຂໍ
POST /v1/telegram/send
{
  "ref": "member-1001",
  "text": "<b>Payment received</b> 500 THB",
  "parse_mode": "HTML"
}

➡️ The member gets the message in Telegram right away

ຕົວຢ່າງທີ 3

Message with a link button

ສະຖານະການ: You want a button to open the order

ສົ່ງຄຳຂໍ
POST /v1/telegram/send
{
  "ref": "member-1001",
  "text": "Order #1001 shipped",
  "button": {
    "text": "View order",
    "url": "https://yourshop.com/orders/1001"
  }
}

➡️ A button under the message opens the link

ຕົວຢ່າງທີ 4

Notify several members at once

ສະຖານະການ: Announce a promotion to three members

ສົ່ງຄຳຂໍ
POST /v1/telegram/send
{
  "refs": [
    "member-1001",
    "member-1002",
    "member-1003"
  ],
  "text": "New promotion today"
}

➡️ Sent to each member; check results with GET /v1/telegram/messages

ຕົວຢ່າງທີ 5

A member stops notifications

ສະຖານະການ: The member asks to disconnect

ສົ່ງຄຳຂໍ
DELETE /v1/telegram/recipients/member-1001

➡️ The link is removed; no more messages are sent

💡 ເພີ່ມເຕີມ

📜 ປະຫວັດການອັບເດດຂອງ 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