跳转到主要内容
POST /api/v1/forward/channels/{channel_id}/qr_sessions 创建 QR session,用于激活或重新绑定支持扫码授权的 Channel。

请求头

Header是否必填说明
AuthorizationBearer <PAT>
Idempotency-Key有副作用请求可选的幂等键。

路径参数

参数类型是否必填说明
channel_idstringChannel ID。

请求体

可省略请求体,也可以发送空 JSON 对象 {}

示例请求

curl -s -X POST 'https://api.qoder.com/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",
  "poll_interval_seconds": 2
}

响应字段

字段类型说明
session_keystring用于轮询状态的不透明 QR session key。
channel_idstring关联的 Channel ID。
channel_typestringwechatfeishudingtalkwecom
statusstring初始状态,通常为 waiting
qr_code_contentstring二维码原始内容,通常是三方授权 URL。
qr_code_image_base64string服务端生成的二维码图片。
expires_atstring过期时间。
poll_interval_secondsinteger建议轮询间隔。

错误

HTTPTypeCode触发条件
400invalid_request_errorchannel_type_unsupported渠道类型不支持 QR session。
404not_found_errorchannel_not_foundChannel 不存在。
409conflict_errorchannel_disabledChannel 已停用。
502api_errorchannel_auth_failed三方渠道授权失败。
401authentication_errorauthentication_requiredPAT 无效或已过期。

注意事项

  • 当前 QR session 支持 wechatfeishudingtalkwecom
  • qq 当前不支持统一 QR session。
  • 请求体可省略或发送 {}

相关

获取 Channel QR Session

获取 Channel