渠道方对比
Zalo 接入授权
Zalo 仅支持 qrcode 登录,无需提前提供凭证 — 用户身份在扫码时才确定。
qrcode
Zalo QR 登录:无需提前传凭证,用户身份在扫码后由 session 载荷揭示。
- 1. POST /v1/accounts,provider=zalo、auth_mode=qrcode。
- 2. POST /v1/accounts/{account_id}/auth/qr/start,响应里的 auth_payload.token 就是用于渲染的 QR token。
- 3. 轮询 POST /v1/accounts/{account_id}/auth/qr/check。过期会返回 qrcode_expired,需要重新调用 qr/start。
- 4. 成功后 POST /v1/accounts/{account_id}/runtime/start。
备注
- QR token 过期会返回 status=qrcode_expired,调用 qr/start 重新获取即可。
- 需要配置 Webhook 端点,用于接收认证与消息事件。
- thread type 为 0 表示好友会话,1 表示群聊。发消息时会做归一化处理。