POST /api/v1/forward/channels/{channel_id}/qr_sessions
创建 QR session,用于激活或重新绑定支持扫码授权的 Channel。
请求头
路径参数
请求体
可省略请求体,也可以发送空 JSON 对象{}。
示例请求
示例响应
HTTP 200 OK响应字段
错误码
注意事项
- 当前 QR session 支持
wechat、feishu、dingtalk和wecom。 - 请求体可省略或发送
{}。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
为 Channel 创建短生命周期扫码授权会话。
POST /api/v1/forward/channels/{channel_id}/qr_sessions
创建 QR session,用于激活或重新绑定支持扫码授权的 Channel。
| Header | 是否必填 | 说明 |
|---|---|---|
| Authorization | 是 | Bearer <PAT> |
| Idempotency-Key | 否 | 有副作用请求可选的幂等键。 |
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| channel_id | string | 是 | Channel ID。 |
{}。
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 '{}'
{
"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 | 用于轮询状态的不透明 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 | 过期时间。 |
| HTTP | Type | 触发条件 |
|---|---|---|
| 400 | invalid_request_error | 渠道类型不支持 QR session。 |
| 401 | authentication_error | PAT 无效或已过期。 |
| 404 | not_found_error | Channel 不存在。 |
| 409 | conflict_error | Channel 已停用。 |
| 502 | api_error | 三方渠道授权失败。 |
wechat、feishu、dingtalk 和 wecom。{}。