POST /api/v1/forward/channels/{channel_id}/qr_sessions
创建 QR session,用于激活或重新绑定支持扫码授权的 Channel。
请求头
| Header | 是否必填 | 说明 |
|---|---|---|
| Authorization | 是 | Bearer <PAT> |
| Idempotency-Key | 否 | 有副作用请求可选的幂等键。 |
路径参数
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| channel_id | string | 是 | Channel ID。 |
请求体
可省略请求体,也可以发送空 JSON 对象{}。
示例请求
示例响应
HTTP 200 OK响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
| session_key | string | 用于轮询状态的不透明 QR session key。 |
| channel_id | string | 关联的 Channel ID。 |
| channel_type | string | wechat、feishu、dingtalk 或 wecom。 |
| status | string | 初始状态,通常为 waiting。 |
| qr_code_content | string | 二维码原始内容,通常是三方授权 URL。 |
| qr_code_image_base64 | string | 服务端生成的二维码图片。 |
| 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 | 三方渠道授权失败。 |
| 401 | authentication_error | authentication_required | PAT 无效或已过期。 |
注意事项
- 当前 QR session 支持
wechat、feishu、dingtalk和wecom。 qq当前不支持统一 QR session。- 请求体可省略或发送
{}。