# 人工客服接口请求示例 这些 JSON 文件用于本地手动调试。示例中的 `conv_id`、`sid` 均须替换成接口实际返回的 ID。 | 文件 | 方法与接口 | 用途 | |---|---|---| | `human_request.json` | POST `/api/human/request` | 为已有聊天会话申请人工客服 | | `human_accept.json` | POST `/api/human/accept` | 客服接待排队中的人工会话 | | `human_send.json` | POST `/api/human/send` | 客服向已接待会话发送消息 | | `human_request_invalid.json` | POST `/api/human/request` | `conv_id=0` 的无效请求示例,预期 HTTP 400 | 在项目根目录执行以下 PowerShell 命令,仅申请人工会话: ```powershell Invoke-RestMethod -Uri 'http://127.0.0.1:5000/api/human/request' ` -Method Post -ContentType 'application/json; charset=utf-8' ` -InFile 'examples/requests/human_request.json' ``` 先通过 POST `/api/new_chat` 获取 `conv_id`,再申请人工客服取得 `session_id`,后续请求中的 `sid` 使用该值。接口当前没有完整登录鉴权,请仅在受控的开发环境调试。