状态回调
AI 智能流式语音识别、智能翻译和会议智能总结在开始服务、服务结束、服务异常等场景下均提供 HTTP 状态回调,您可以获取服务状态信息和结果。如果您已开通上述服务,并配置了公网可访问的回调 URL,融云会将服务的状态变化实时通知您在控制台配置的服务器地址。
请在控制 台的 AI 智能流式语音识别 / 会议智能总结配置页面,填写接收 HTTP 回调的 URL,配置后 15 分钟内生效。
回调方法
POST:<your-receiving-server-url>
数据格式:application/json
回调地址 <your-receiving-server-url> 是您在控制台为当前 App Key 和服务所配置的回调接收地址。请务必配置可正常访问的回调接收地址。如果您的网络有 IP 访问限制,请务必配置 IP 白名单,否则无法正常接收服务端回调。
为了验证数据有效性并确保调用者为融云 Server,每个请求前添加数据签名。回调签名规则详见服务端回调。
通用字段
下表描述了 AI 智能流式语音识别和智能翻译服务回调请求的通用字段:
| 字段名称 | 类型 | 说明 |
|---|---|---|
| type | String | 回调类型:asr 表示语音转写,tr 表示翻译,sum 表示会议智能总结。 |
| status | String | 回调事件类型,如下:started: 服务开始;stopped: 服务结束;exception: 任务异常;failed: 服务失败 |
| appKey | String | 当前使用的 App Key。 |
| roomId | String | 房间 ID 。 |
| code | Number | 状态码,10000 为正常。 |
| errorMessage | String | 错误信息,成功时为 "Success"。 |
当 type 为 sum(会议智能总结)时,回调请求还会包含字段 taskId(String),表示当前会议总结任务的 ID,与「开始会议智能总结」接口返回的 taskId 一致,可用于关联后续的生成总结、获取转写等请求。
语音转写回调
转写服务开始回调
HTTP
POST /any-url-path HTTP/1.1
Host: your.app.server
Content-Type: application/json
{
"type": "asr",
"status": "started",
"appKey": "your_appkey",
"roomId": "111",
"code": 10000,
"errorMessage": "Success"
}
转写服务结束回调
HTTP
POST /any-url-path HTTP/1.1
Host: your.app.server
Content-Type: application/json
{
"type": "asr",
"status": "stopped",
"appKey": "your_appkey",
"roomId": "111",
"code": 10000,
"errorMessage": "Success"
}
转写服务异常回调
HTTP
POST /any-url-path HTTP/1.1
Host: your.app.server
Content-Type: application/json
{
"type": "asr",
"status": "exception",
"appKey": "your_appkey",
"roomId": "111",
"code": 50001,
"errorMessage": "ASR Service Exception"
}
转写服务失败回调
HTTP
POST /any-url-path HTTP/1.1
Host: your.app.server
Content-Type: application/json
{
"type": "asr",
"status": "failed",
"appKey": "your_appkey",
"roomId": "111",
"code": 40001,
"errorMessage": "ASR Service Failed"
}
翻译回调
翻译服务回调除了包含通用字段外,还包含以下额外字段:
| 字段名称 | 类型 | 说明 |
|---|---|---|
| userId | String | 用户 ID,指明哪个用户的翻译服务 |
| msLabel | String | 流标签,指明哪个流的翻译 |
| srcLanguage | String | 翻译的原语言 |
| targetLanguage | String | 翻译的目标语言 |
翻译服务开始回调
HTTP
POST /any-url-path HTTP/1.1
Host: your.app.server
Content-Type: application/json
{
"type": "tr",
"status": "started",
"appKey": "your_appkey",
"roomId": "111",
"userId": "user123",
"msLabel": "user123_RongCloudRTC",
"srcLanguage": "zh",
"targetLanguage": "en",
"code": 10000,
"errorMessage": "Success"
}
翻译服务结束回调
HTTP
POST /any-url-path HTTP/1.1
Host: your.app.server
Content-Type: application/json
{
"type": "tr",
"status": "stopped",
"appKey": "your_appkey",
"roomId": "111",
"userId": "user123",
"msLabel": "user123_RongCloudRTC",
"srcLanguage": "zh",
"targetLanguage": "en",
"code": 10000,
"errorMessage": "Success"
}
翻译服务异常回调
HTTP
POST /any-url-path HTTP/1.1
Host: your.app.server
Content-Type: application/json
{
"type": "tr",
"status": "exception",
"appKey": "your_appkey",
"roomId": "111",
"userId": "user123",
"msLabel": "user123_RongCloudRTC",
"srcLanguage": "zh",
"targetLanguage": "en",
"code": 50001,
"errorMessage": "Translation Service Exception"
}
翻译服务失败回调
HTTP
POST /any-url-path HTTP/1.1
Host: your.app.server
Content-Type: application/json
{
"type": "tr",
"status": "failed",
"appKey": "your_appkey",
"roomId": "111",
"userId": "user123",
"msLabel": "user123_RongCloudRTC",
"srcLanguage": "zh",
"targetLanguage": "en",
"code": 40001,
"errorMessage": "Translation Service Failed"
}
会议智能总结回调
当房间内开启或停止会议智能总结时,融云会向您配置的回调地址发送状态通知。回调请求中 type 固定为 sum,并包含 taskId(与「开始会议智能总结」接口返回的 taskId 一致)。
会议总结专用字段
除通用字段外,会议总结回调还包含以下字段:
| 字段名称 | 类型 | 说明 |
|---|---|---|
| taskId | String | 会议总结任务 ID(JWT),与「开始会议智能总结」接口返回的 taskId 一致,用于后续「生成会议总结」「获取会议转写」等接口。 |
会议总结服务开始回调
当 某房间成功开启会议智能总结时触发。
HTTP
POST /any-url-path HTTP/1.1
Host: your.app.server
Content-Type: application/json
{
"type": "sum",
"status": "started",
"appKey": "your_appkey",
"roomId": "111",
"taskId": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"code": 10000,
"errorMessage": "Success"
}
会议总结服务结束回调
当某房间停止会议智能总结时触发。
HTTP
POST /any-url-path HTTP/1.1
Host: your.app.server
Content-Type: application/json
{
"type": "sum",
"status": "stopped",
"appKey": "your_appkey",
"roomId": "111",
"taskId": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"code": 10000,
"errorMessage": "Success"
}
响应回调请求
您的服务在收到 HTTP 回调之后,需要返回 200 OK 表示接收成功。
回调状态码说明:
- 当语音识别或翻译服务出现故障时,会立即回调异常或失败状态。
- 建议在您收到异常或失败回调后检查服务的状态,并及时处理相关错误。
最后于 2025年1月27日 更新