TUNGKAO Dokumentasi API
Tekan tombol lalu pilih “Simpan sebagai PDF”

TUNGKAO API

Notifikasi Telegram

API v1 · Terakhir diperbarui: Waktu Thailand (UTC+07:00)

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

Sesuai ketentuan, halaman yang memakai layanan wajib menampilkan “Powered by TUNGKAO” (atau “Secured by TUNGKAO” untuk login/pembayaran) yang tertaut ke https://tungkao.com

API · telegram_notify

Notifikasi Telegram

Kirim pesan Telegram ke pengguna lewat bot TUNGKAO — tanpa bot sendiri. Mis. dana masuk, status pesanan, OTP.

🕒 Terakhir diperbarui: Waktu Thailand (UTC+07:00) · ✅ Kode lama tetap berjalan

🤖 Minta AI menulis integrasinya

Salin tautan ini untuk dibaca AI (seluruh API dalam Markdown) atau tekan tombol: prompt disalin dan AI dibuka

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

Tautan ini mengembalikan pembaruan API ini sebagai JSON (tanpa key, dari asal mana pun). Tampilkan di halaman admin sebagai kotak “Pengumuman pembaruan” dan tandai “Baru” saat last_updated berubah

Salin + buka di: Menekan tombol AI otomatis menyalin prompt — jika kotak chat kosong, tinggal tempel

🔑 Key yang dipakai

Buat key telegram_notify di portal merchant (API key) dan kirim header ini di setiap request — key layanan lain tidak berfungsi di sini

Authorization: Bearer $TUNGKAO_KEY

📋 Langkah

  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.

📡 Panggilan API + contoh kode

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"

📚 Contoh penggunaan

Contoh 1

Let a member connect Telegram

Situasi: Member member-1001 wants notifications on Telegram

Permintaan
POST /v1/telegram/link
{
  "ref": "member-1001"
}
Contoh respons
{
  "success": true,
  "data": {
    "url": "https://t.me/…?start=…"
  }
}

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

Contoh 2

Notify a payment

Situasi: 500 THB arrived and you want to notify the member

Permintaan
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

Contoh 3

Message with a link button

Situasi: You want a button to open the order

Permintaan
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

Contoh 4

Notify several members at once

Situasi: Announce a promotion to three members

Permintaan
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

Contoh 5

A member stops notifications

Situasi: The member asks to disconnect

Permintaan
DELETE /v1/telegram/recipients/member-1001

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

💡 Lainnya

📜 Riwayat pembaruan API ini

  1. Ditambah Waktu Thailand (UTC+07:00)
    API update announcements by webhook: new api.update event (opt in per key on the key card; off by default)
  2. Dokumen Waktu Thailand (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. Ditambah Waktu Thailand (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. Ditambah Waktu Thailand (UTC+07:00)
    GET /status: status API per layanan (tanpa key)
  5. Ditambah Waktu Thailand (UTC+07:00)
    Sakelar on/off key dengan waktu perubahan + satu key per layanan per situs
  6. Ditingkatkan Waktu Thailand (UTC+07:00)
    API v1 dibekukan permanen (hanya penambahan) + header X-Tungkao-Api-Version + pemberitahuan penghentian 12 bulan
  7. Dokumen Waktu Thailand (UTC+07:00)
    Halaman dokumen per API dengan tautan AI (10 bahasa)
  8. Keamanan Waktu Thailand (UTC+07:00)
    Verifikasi domain per API key (1 key = 1 situs) — key lama tetap berfungsi
  9. Ditambah Waktu Thailand (UTC+07:00)
    Tanda tangan request HMAC opsional — tidak ada yang berubah jika tidak diaktifkan
  10. Baru Waktu Thailand (UTC+07:00)
    Meluncurkan notifikasi Telegram dan Discord
  11. Ditambah Waktu Thailand (UTC+07:00)
    Masa berlaku API key, pengingat, dan perpanjangan — string key tidak berubah
  12. Ditambah Waktu Thailand (UTC+07:00)
    Key mode test (simulasi, gratis) untuk semua layanan

✅ Kode lama tetap berjalan

🛡️ Janji stabilitas: integrasi sekali, terus berjalan

🚦 Status sistem (GET /status)

Cek kapan saja apakah API normal — tanpa 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"
  }
}

🏷️ Ketentuan mencantumkan kredit TUNGKAO

Powered by TUNGKAO