全部產品
Search
文件中心

Qoder CN 系列:建立 Channel QR Session

更新時間:Jul 03, 2026

為 Channel 建立短生命週期掃碼授權會話。

要求標頭

Header

是否必填

說明

Authorization

Bearer <PAT>

Idempotency-Key

有副作用請求可選的等冪鍵。

路徑參數

參數

類型

是否必填

說明

channel_id

string

Channel ID。

請求體

可省略請求體,也可以發送空 JSON 對象 {}

樣本請求

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/channels/channel-019eabc123/qr_sessions' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{}'

樣本響應

HTTP 200 OK

{
  "session_key": "qr-a1b2c3d4",
  "channel_id": "channel-dingtalk-001",
  "channel_type": "dingtalk",
  "status": "waiting",
  "qr_code_content": "https://login.dingtalk.com/oauth2/...",
  "qr_code_image_base64": "data:image/png;base64,...",
  "expires_at": "2026-06-18T10:05:00Z"
}

響應欄位

欄位

類型

說明

session_key

string

用於輪詢狀態的 opaque QR session key。

channel_id

string

關聯的 Channel ID。

channel_type

string

wechatfeishudingtalkwecom

status

string

初始狀態,通常為 waiting

qr_code_content

string

二維碼原始內容,通常是三方授權 URL。

qr_code_image_base64

string

Gateway 產生的二維碼圖片。

expires_at

string

到期時間。

poll_interval_seconds

integer

建議輪詢間隔。

錯誤

HTTP

Type

Code

觸發條件

400

invalid_request_error

channel_type_unsupported

渠道類型不支援 QR session。

404

not_found_error

channel_not_found

Channel 不存在。

409

conflict_error

channel_disabled

Channel 已停用。

502

api_error

channel_auth_failed

Gateway 或三方授權失敗。

401

authentication_error

authentication_required

PAT 無效或已到期。

備忘

  • P0 QR session 支援 wechatfeishudingtalkwecom

  • qq 在 P0 不支援統一 QR session。

  • 請求體可省略或發送 {}

相關