TUNGKAO ເອກະສານ API
ກົດປຸ່ມແລ້ວເລືອກ “Save as PDF”

TUNGKAO API

ສົ່ງອີເມວ + OTP + SMTP

API v1 · ອັບເດດລ່າສຸດ: ເວລາປະເທດໄທ (UTC+07:00)

https://tungkao.com · https://api.tungkao.com/docs

ຕ້ອງສະແດງ “Powered by TUNGKAO” ເປັນລິ້ງໄປ https://tungkao.com ໃນໜ້າທີ່ໃຊ້ບໍລິການ

📧
API · email

ສົ່ງອີເມວ + OTP + SMTP

ສົ່ງອີເມວຈາກເວັບທ່ານຜ່ານ API ຫຼື SMTP (ໃຊ້ກັບ WordPress ໄດ້) ພ້ອມ OTP ທາງອີເມວ — ສະຫຼັບຄ່າຍສົ່ງອີເມວອັດຕະໂນມັດ

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

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

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

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

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

ChatGPT ↗Claude ↗Gemini ↗Grok ↗

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

🔑 key ທີ່ໃຊ້

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

Authorization: Bearer $TUNGKAO_KEY

📋 ຂັ້ນຕອນ

  1. ສ້າງ key ອີເມວ (key ທົດສອບສົ່ງໄດ້ສະເພາະອີເມວຂອງທ່ານ 50 ສະບັບ/ວັນ)
  2. SMTP: host smtp.tungkao.com ພອດ 587 (STARTTLS) ຫຼື 465 (SSL) ຊື່ຜູ້ໃຊ້ຫຍັງກໍໄດ້ ລະຫັດຜ່ານ = API key
  3. API: ສົ່ງອີເມວ ຫຼື ຂໍ OTP ແລ້ວກວດດ້ວຍ otp_id (5 ຄັ້ງ ໃຊ້ໄດ້ຄັ້ງດຽວ)

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

POST/v1/email/send
curl -X POST https://api.tungkao.com/v1/email/send \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":["[email protected]"],"subject":"Order #1001 confirmed","html":"<h1>Thanks for your order</h1>","text":"Thanks for your order","from_name":"My Shop","reply_to":"[email protected]"}'
POST/v1/email/otp/send
curl -X POST https://api.tungkao.com/v1/email/otp/send \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"[email protected]","brand":"My Shop","lang":"th","length":6,"ttl_seconds":300}'
POST/v1/email/otp/verify
curl -X POST https://api.tungkao.com/v1/email/otp/verify \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"otp_id":"8f6c2a1e-…","code":"123456"}'

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

ຕົວຢ່າງທີ 1

Order confirmation email

ສະຖານະການ: A customer completes an order

ສົ່ງຄຳຂໍ
POST /v1/email/send
{
  "to": [
    "[email protected]"
  ],
  "subject": "Order #1001 confirmed",
  "html": "<h1>Thanks for your order</h1>",
  "text": "Thanks for your order",
  "from_name": "My Shop",
  "reply_to": "[email protected]"
}

➡️ Always send html and text; replies go to reply_to

ຕົວຢ່າງທີ 2

Send an email OTP

ສະຖານະການ: A new sign-up must confirm their email

ສົ່ງຄຳຂໍ
POST /v1/email/otp/send
{
  "to": "[email protected]",
  "brand": "My Shop",
  "lang": "th",
  "length": 6,
  "ttl_seconds": 300
}
ຕົວຢ່າງຜົນຕອບກັບ
{
  "success": true,
  "data": {
    "otp_id": "8f6c2a1e-…"
  }
}

➡️ Keep otp_id; the code expires in 5 minutes

ຕົວຢ່າງທີ 3

Check the OTP

ສະຖານະການ: The user types the 6-digit code

ສົ່ງຄຳຂໍ
POST /v1/email/otp/verify
{
  "otp_id": "8f6c2a1e-…",
  "code": "123456"
}

➡️ Correct = email confirmed · too many wrong tries = code locked, send a new one

ຕົວຢ່າງທີ 4

Send to several people

ສະຖານະການ: Tell three staff about a large order

ສົ່ງຄຳຂໍ
POST /v1/email/send
{
  "to": [
    "[email protected]",
    "[email protected]",
    "[email protected]"
  ],
  "subject": "Large order #1002",
  "text": "Order #1002: 25,000 THB"
}

➡️ Everyone listed receives the email

ຕົວຢ່າງທີ 5

Review sent emails

ສະຖານະການ: A customer says the email never arrived

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

➡️ Check the delivery status of each email

💡 ເພີ່ມເຕີມ

📜 ປະຫວັດການອັບເດດຂອງ 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)
    error.user_message: ready-to-show text for end users on outages, no credits or key problems (white-label keys omit tungkao.com)
  3. ເພີ່ມ ເວລາປະເທດໄທ (UTC+07:00)
    GET /status: ສະຖານະ API ແຍກທຸກບໍລິການ (ບໍ່ຕ້ອງໃຊ້ key)
  4. ເປີດໃໝ່ ເວລາປະເທດໄທ (UTC+07:00)
    ເປີດບໍລິການສົ່ງອີເມວ: API + SMTP + OTP
  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)
    ກຳນົດອາຍຸ API key + ແຈ້ງເຕືອນ + ຕໍ່ອາຍຸ key ເດີມໃຊ້ຕໍ່ໄດ້
  11. ເພີ່ມ ເວລາປະເທດໄທ (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