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

Zalo ဖြင့် ဝင်ရောက်

Zalo တွင် ကိုယ်တိုင်မှတ်ပုံမတင်ဘဲ သင့်ဆိုက်တွင် 'Zalo ဖြင့်ဝင်ရောက်' ခလုတ်ထည့်ပါ။ ရရှိမည်: name, photo (no email)

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

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

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

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

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

ChatGPT ↗Claude ↗Gemini ↗Grok ↗

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

🔑 သုံးရမည့် key

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

Authorization: Bearer $TUNGKAO_KEY

🔗 သင့် Sign-in ခလုတ်လင့်ခ်

https://api.tungkao.com/oauth/authorize?client_id=<CLIENT_ID>&redirect_uri=https%3A%2F%2Fyourshop.com%2Fauth%2Fcallback&state=<RANDOM>

🛡️ အားလုံး tungkao တွင်ပြီး: အသုံးပြုသူ Zalo ဖြင့်ဝင်ပြီး tungkao သို့ အမြဲအရင်ပြန်လာသည်။ sign-in အမှန်အောင်မြင်မှ (သို့ ဝင်စဉ်ပယ်ဖျက်မှ) သာ သင့်လင့်ခ်သို့ပို့သည် — လင့်ခ်တိုက်ရိုက်ဖွင့်သူ tungkao စာမျက်နှာကိုသာမြင်ရ။ 'အဖွဲ့ဝင်များ' တွင် 🌐 domain (အတည်ပြု) နှင့် ↩️ ပြန်လာလင့်ခ်သတ်မှတ်ပါ

ရရှိမည်: name, photo (no email)

📋 အဆင့်များ

  1. provider အတွက် key ဖန်တီးပြီး 'Sign-in အဖွဲ့ဝင်များ' တွင် ဆိုက်အမည်နှင့် redirect URI (https၊ အတိအကျ) သတ်မှတ်ပါ
  2. Sign-in ခလုတ်က အသုံးပြုသူကို client_id (key ID)၊ redirect_uri နှင့် state (အကြိမ်တိုင်း random အသစ်၊ session တွင်သိမ်း) ဖြင့် /oauth/authorize သို့ပို့သည်
  3. အသုံးပြုသူ redirect_uri?code=…&state=… သို့ပြန်လာ → state စစ် → server က ၂ မိနစ်အတွင်း POST /v1/login/token ခေါ်
  4. data.user (ဥပမာ 7F3K9QX2-yourshopcom) ကို member ID အဖြစ်သုံးပါ — လူတစ်ဦးသည် ID တစ်ခုတည်းအမြဲရ

📡 API ခေါ်ဆိုမှု + ကုဒ်နမူနာ

POST/v1/login/token
curl -X POST https://api.tungkao.com/v1/login/token \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"from the redirect","redirect_uri":"https://yourshop.com/auth/callback"}'
GET/v1/login/users?limit=50
curl -X GET https://api.tungkao.com/v1/login/users?limit=50 \
  -H "Authorization: Bearer $TUNGKAO_KEY"

📖 Summary: using sign-in keys on several sites

ကိစ္စkey သတ်မှတ်ချက် (API Keys စာမျက်နှာ)ရလဒ်
One site, 2 keys of the same provider (e.g. website + app, both Google)Both keys: Combined (default)The same person gets the same user ID in both ✅
One site, 2 keys of the same provider, counted as separate accountsBoth keys: SeparateThe same person gets a different user ID on each key
2 sister sites sharing membersBoth keys: Group AA member has the same user ID on both sites ✅
2 unrelated sites that must not link membersBoth keys: SeparateDifferent user IDs, so the sites can't link their members ✅
A Google key and a LINE key (different providers)Any settingAlways different user IDs — they are different provider accounts
A key that already has sign-ins needs a different groupNot allowed (locked 🔒)Create a new key in the wanted group, so member IDs on your site never change

Set it on the “Sign-in user IDs between keys” card on the API Keys page before go-live (new keys default: Combined). Several keys may use the same domain.

ပြည့်စုံသောနမူနာ (ခလုတ် + callback + code လဲ)

// npm i express express-session
import express from "express";
import session from "express-session";
import crypto from "node:crypto";

const KEY = process.env.TUNGKAO_KEY;            // API key (tk_live_…) server-side only
const CLIENT_ID = process.env.TUNGKAO_CLIENT_ID; // the key id (shown in the portal), not a secret
const REDIRECT = "https://yourshop.com/auth/callback"; // must match the registered URL exactly

const app = express();
app.use(session({ secret: process.env.SESSION_SECRET, resave: false, saveUninitialized: false, cookie: { secure: true, sameSite: "lax" } }));

// 1) your "Sign in" button links here
app.get("/auth/login", (req, res) => {
  req.session.state = crypto.randomBytes(24).toString("base64url");
  const u = new URL("https://api.tungkao.com/oauth/authorize");
  u.search = new URLSearchParams({ client_id: CLIENT_ID, redirect_uri: REDIRECT, state: req.session.state });
  res.redirect(u);
});

// 2) the user comes back with a code
app.get("/auth/callback", async (req, res) => {
  if (!req.query.state || req.query.state !== req.session.state) return res.status(400).send("state mismatch");
  delete req.session.state;
  if (req.query.error) return res.redirect("/login?cancelled=1");
  // 3) exchange the code for the user (within 2 minutes)
  const r = await fetch("https://api.tungkao.com/v1/login/token", {
    method: "POST",
    headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json" },
    body: JSON.stringify({ code: req.query.code, redirect_uri: REDIRECT }),
  });
  const j = await r.json();
  if (!j.success) return res.status(400).send(j.error.message);
  req.session.user = j.data; // j.data.user = permanent member id, e.g. 7F3K9QX2-yourshopcom
  res.redirect("/");
});
app.listen(3000);
ProviderServiceရရှိမည်
Googlegoogle_loginအမည်၊ အတည်ပြုပြီး email၊ ဓာတ်ပုံ
LINEline_loginအမည်၊ ဓာတ်ပုံ၊ သဘောတူလျှင် email
Facebookfacebook_loginအမည်၊ ဓာတ်ပုံ၊ email
TikToktiktok_loginပြသအမည်၊ avatar (email မပါ)
Discorddiscord_loginအမည်၊ avatar၊ email
Telegramtelegram_loginname, username, photo
X (Twitter)x_loginname, username, photo
Microsoftmicrosoft_loginname, email (Hotmail/Outlook)
GitHubgithub_loginname, email, avatar
Appleapple_loginpermanent member ID (no name or email in this mode)
Steamsteam_loginname, avatar and SteamID (no email)
Twitchtwitch_loginname, email, avatar
LinkedInlinkedin_loginname, email, photo
Kakaokakao_loginname, photo (email once Kakao approves it)
NAVERnaver_loginname, email, photo
Zalozalo_loginname, photo (no email)
Spotifyspotify_loginname, email, photo
Redditreddit_loginusername, avatar (no email)
GitLabgitlab_loginname, email, avatar
Robloxroblox_loginname, avatar (no email)
Epic Gamesepicgames_logindisplay name (no email)
Yahooyahoo_loginname, email, photo
Slackslack_loginname, email, photo
Amazonamazon_loginname, email

📚 အသုံးပြုပုံ ဥပမာများ

ဥပမာ 1

A “Sign in with Zalo” button on your site

အခြေအနေ: A visitor taps Sign in with Zalo on your site

တောင်းဆိုချက်
GET /oauth/authorize?client_id=<CLIENT_ID>&redirect_uri=https://yourshop.com/auth/callback&state=xyz

➡️ The user signs in with Zalo and returns to redirect_uri with a code and the same state

ဥပမာ 2

Exchange the code for the user (server side)

အခြေအနေ: Your server receives the code on the callback page (exchange within 2 minutes)

တောင်းဆိုချက်
POST /v1/login/token
{
  "code": "<code from the callback>",
  "redirect_uri": "https://yourshop.com/auth/callback"
}
နမူနာ တုံ့ပြန်ချက်
{
  "success": true,
  "data": {
    "user": "7F3K9QX2-yourshopcom",
    "provider": "zalo",
    "name": "Somchai",
    "is_new_user": true
  }
}

➡️ Use user as the member id in your database (stable per person)

ဥပမာ 3

A returning user signs in

အခြေအနေ: The same person signs in with Zalo again

နမူနာ တုံ့ပြန်ချက်
{
  "success": true,
  "data": {
    "user": "7F3K9QX2-yourshopcom",
    "is_new_user": false,
    "login_count": 5
  }
}

➡️ Same user every time → look up the member and sign them in

ဥပမာ 4

One site, two Zalo keys (website + app)

အခြေအနေ: Separate keys for website and app, same members

➡️ Keep both keys “Combined” (default) before go-live → same user for the same person. Choose “Separate” to keep them apart

ဥပမာ 5

List members who signed in

အခြေအနေ: You want to browse or search members of this key

တောင်းဆိုချက်
GET /v1/login/users?q=somchai&limit=50

➡️ Returns members with last sign-in time and count

ဥပမာ 6

The user cancels during sign-in

အခြေအနေ: The user cancels on the Zalo screen

➡️ Returns to redirect_uri with error instead of code; show a retry button

💡 နောက်ထပ်

📜 ဤ API ၏ အပ်ဒိတ်မှတ်တမ်း

  1. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods.
  2. တိုးတက် ထိုင်းစံတော်ချိန် (UTC+07:00)
    🌐 The sign-in page and the phone-model sign-in help now support all 10 API languages (th, en, lo, my, zh-CN, ko, ja, vi, km, id), picked from the device language or &lang= on the sign-in link, with a language switcher at the bottom
  3. တိုးတက် ထိုင်းစံတော်ချိန် (UTC+07:00)
    📱 The sign-in help page now names the visitor's exact phone model (e.g. Galaxy S24 Ultra), adds model search, and refreshes the Android model list daily from Google Play — new models get a “New” badge
  4. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    📱 Step-by-step “sign-in doesn't continue” help by phone brand and model (iPhone, iPad, Samsung, Huawei, HONOR, Xiaomi, OPPO, vivo, realme, OnePlus, Pixel, other Android), with the brand guessed from the device and a link from the sign-in page
  5. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group
  6. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    15 new sign-in providers: Apple, Steam, Twitch, LinkedIn, Kakao, NAVER, Zalo, Spotify, Reddit, GitLab, Roblox, Epic Games, Yahoo, Slack, Amazon. Same /oauth/authorize link and POST /v1/login/token as every existing provider (each one goes on sale when ready; see the services page)
  7. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    API update announcements by webhook: new api.update event (opt in per key on the key card; off by default)
  8. ထပ်ထည့် ထိုင်းစံတော်ချိန် (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)
  9. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    GET /status: ဝန်ဆောင်မှုအလိုက် API အခြေအနေ (key မလို)
  10. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    key ဖွင့်/ပိတ် ခလုတ်နှင့် ပြောင်းချိန် + ဝက်ဘ်ဆိုက်တစ်ခု ဝန်ဆောင်မှုတစ်ခုလျှင် key ၁ ခု
  11. တိုးတက် ထိုင်းစံတော်ချိန် (UTC+07:00)
    API v1 ကိုအမြဲပိတ် (ထပ်ထည့်ရုံသာ) + X-Tungkao-Api-Version header + ၁၂ လကြိုတင်အသိပေး
  12. စာရွက်စာတမ်း ထိုင်းစံတော်ချိန် (UTC+07:00)
    API တစ်ခုချင်း docs စာမျက်နှာ + AI လင့်ခ် (ဘာသာ ၁၀)
  13. လုံခြုံရေး ထိုင်းစံတော်ချိန် (UTC+07:00)
    API key တစ်ခုချင်း domain အတည်ပြု (key 1 = site 1) — key ဟောင်းများ ဆက်သုံးနိုင်
  14. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    HMAC request လက်မှတ် (ရွေးချယ်) — မဖွင့်လျှင် ဘာမှမပြောင်း
  15. ထပ်ထည့် ထိုင်းစံတော်ချိန် (UTC+07:00)
    API key သက်တမ်း + သတိပေး + သက်တမ်းတိုး — key စာသားမပြောင်း
  16. ထပ်ထည့် ထိုင်းစံတော်ချိန် (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