API 參考
渠道方對比

Zalo 接入授權

Zalo 僅支援 qrcode 登入,無需事先提供憑證 — 使用者身分要等掃碼時才知道。

qrcode

Zalo QR 登入:無需事先帶憑證,使用者身分在掃碼後由 session payload 揭示。

  1. 1. POST /v1/accounts,provider=zalo、auth_mode=qrcode。
  2. 2. POST /v1/accounts/{account_id}/auth/qr/start,回應裡的 auth_payload.token 就是用於顯示的 QR token。
  3. 3. 輪詢 POST /v1/accounts/{account_id}/auth/qr/check。過期會回 qrcode_expired,需要重新呼叫 qr/start。
  4. 4. 成功後 POST /v1/accounts/{account_id}/runtime/start。

備註

  • QR token 過期會回 status=qrcode_expired,呼叫 qr/start 重新取得即可。
  • 需要配置 Webhook 端點,用於接收認證與訊息事件。
  • thread type 為 0 表示好友會話,1 表示群組。傳訊息時會做歸一化。