Appearance
直播详情
基本信息
| 项目 | 说明 |
|---|---|
| 接口路径 | POST /v1/live/detail |
| 响应类型 | application/json |
| 认证方式 | API Key + 请求签名(认证说明) |
请求体
json
{
"id": 123,
"language": "zh"
}| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | number | ✅ | 直播 ID,来自直播列表接口 |
language | string | ✅ | 语言代码,如 zh、en、ja |
响应格式
成功响应
json
{
"code": 10200,
"success": true,
"message": "OK",
"data": {
"id": "123",
"agent_id": "agent-uuid",
"agent_name": "Aria",
"cover": "https://cdn.example.com/cover.jpg",
"scenes": [
{
"scene_id": "1",
"scene_display_name": "办公室",
"scene_order": 1,
"videos": [
{
"video_id": "101",
"video_display_name": "日常问候",
"video_type": "free",
"video_url": "https://cdn.example.com/video.mp4",
"video_order": 1,
"play_coins": 0,
"show_hardware_sync": false,
"prev_video_id": null,
"next_video_id": "102"
}
]
}
]
}
}| 字段 | 类型 | 说明 |
|---|---|---|
data.id | string | 直播 ID |
data.agent_id | string | 角色 ID |
data.agent_name | string | 角色名称 |
data.cover | string | 封面图 URL |
data.scenes | array | 场景列表,按 scene_order 升序排列 |
data.scenes[].scene_id | string | 场景 ID |
data.scenes[].scene_display_name | string | 场景展示名称 |
data.scenes[].scene_order | number | 场景排序权重 |
data.scenes[].videos | array | 场景内视频列表,按 video_order 升序排列 |
data.scenes[].videos[].video_id | string | 视频 ID |
data.scenes[].videos[].video_display_name | string | 视频展示名称 |
data.scenes[].videos[].video_type | string | 视频类型(如 free、paid) |
data.scenes[].videos[].video_url | string | 视频播放地址 |
data.scenes[].videos[].video_order | number | 视频排序权重 |
data.scenes[].videos[].play_coins | number | 解锁所需金币数,0 表示免费 |
data.scenes[].videos[].show_hardware_sync | boolean | 是否展示硬件同步功能 |
data.scenes[].videos[].prev_video_id | string | null | 前一个视频 ID,无则为 null |
data.scenes[].videos[].next_video_id | string | null | 后一个视频 ID,无则为 null |
错误响应
| HTTP 状态码 | 说明 |
|---|---|
401 | 认证失败 |
400 | 请求参数缺失或格式错误 |
500 | 服务内部错误 |
业务错误(HTTP 200):
| message | 说明 |
|---|---|
Live stream not found | 直播不存在或无对应语言内容 |
Invalid API key | API Key 无效或已禁用 |
客户端示例
javascript
async function getLiveDetail(apiKey, apiSecret, userId, liveId, language = 'zh') {
const body = { id: liveId, language }
const headers = await buildAuthHeaders(apiKey, apiSecret, userId, body)
const response = await fetch('/v1/live/detail', {
method: 'POST',
headers,
body: JSON.stringify(body),
})
const result = await response.json()
if (!result.success) throw new Error(result.message)
return result.data // { id, agent_id, agent_name, cover, scenes }
}