TUNGKAO API 문서
버튼을 누르고 대상에서 “PDF로 저장”을 선택하세요

TUNGKAO API

이메일 발송 + OTP + SMTP

API v1 · 최근 업데이트: 태국 시간 (UTC+07:00)

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

이용 약관에 따라 서비스를 사용하는 페이지에 https://tungkao.com 링크가 있는 “Powered by TUNGKAO”(로그인/결제는 “Secured by TUNGKAO”)를 표시해야 합니다

📧
API · email

이메일 발송 + OTP + SMTP

API 또는 SMTP로 사이트에서 이메일을 보내고(WordPress 지원), 이메일 OTP 발송과 확인까지 — 이메일 제공자 간 자동 전환.

🕒 최근 업데이트: 태국 시간 (UTC+07:00) · ✅ 기존 코드 그대로 작동

🤖 AI에게 연동 코드 맡기기

이 링크를 AI에게 주거나(전체 API Markdown) 버튼을 누르세요. 프롬프트가 복사되고 AI가 열립니다

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

이 링크는 이 API의 업데이트를 JSON으로 돌려줍니다 (key 불필요, 모든 출처 허용). 관리자 페이지에 “업데이트 공지” 상자로 보여 주고 last_updated가 바뀌면 “새 글”로 표시하세요

ChatGPT ↗Claude ↗Gemini ↗Grok ↗

복사 후 열기: AI 버튼을 누르면 프롬프트가 자동 복사됩니다. 입력창이 비어 있으면 붙여넣기 하세요

🔑 사용할 키

판매자 포털(API key)에서 email 키를 만들고 모든 요청에 이 header를 보내세요 — 다른 서비스의 키는 여기서 작동하지 않습니다

Authorization: Bearer $TUNGKAO_KEY

📋 진행 방법

  1. 이메일 키를 만드세요 (테스트 키는 내 주소로만, 하루 50통).
  2. SMTP: 호스트 smtp.tungkao.com, 포트 587(STARTTLS) 또는 465(SSL), 사용자 이름 아무거나, 비밀번호 = API 키.
  3. API: 이메일을 보내거나 OTP를 요청하고 받은 otp_id로 확인 (5회, 1회용).

📡 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 상태 (키 불필요)
  4. 출시 태국 시간 (UTC+07:00)
    이메일 서비스 출시: API + SMTP + 이메일 OTP
  5. 추가 태국 시간 (UTC+07:00)
    키 켜기/끄기 스위치와 상태 변경 시각 + 웹사이트당 서비스별 키 1개
  6. 개선 태국 시간 (UTC+07:00)
    API v1 영구 고정(추가만 가능) + X-Tungkao-Api-Version header + 12개월 사전 지원 종료 알림
  7. 문서 태국 시간 (UTC+07:00)
    API별 문서 페이지와 AI 링크 (10개 언어)
  8. 보안 태국 시간 (UTC+07:00)
    API 키별 도메인 인증 (키 1개 = 사이트 1개) — 기존 키는 그대로 작동
  9. 추가 태국 시간 (UTC+07:00)
    선택형 HMAC 요청 서명 — 켜지 않으면 변화 없음
  10. 추가 태국 시간 (UTC+07:00)
    API 키 기간·만료 알림·갱신 — 키 문자열은 그대로
  11. 추가 태국 시간 (UTC+07:00)
    모든 서비스에 test 모드 키 (모의, 무료)

✅ 기존 코드 그대로 작동

🛡️ 안정성 약속: 한 번 연동하면 계속 작동

🚦 시스템 상태 (GET /status)

API 정상 여부를 언제든 확인 — 키 불필요

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