内容资源私有库API
更新时间:2026-02-05
创建私有库
接口描述
创建私有库(注意,限制最多创建5个)
请求语法
JSON
1POST /api/v{version}/content/database/create HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
无
请求示例
JSON
1POST /api/v1/content/database/create HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| result | String | 操作结果 |
| dbName | String | 私有库名 |
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
7{
8 "result": "success",
9 "dbName": "content-1111"
10}
删除私有库
接口描述
删除私有库
请求语法
JSON
1POST /api/v{version}/content/database/delete HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| dbName | String | 是 | 私有库名称 |
请求示例
JSON
1POST /api/v1/content/database/delete HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
6
7{
8 "dbName": "content-1111"
9}
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| result | String | 操作结果 |
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
7{
8 "result": "success"
9}
查询私有库
接口描述
查询私有库列表
请求语法
JSON
1POST /api/v{version}/content/database/list HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
无
请求示例
JSON
1POST /api/v1/content/database/list HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| result | String | 操作结果 |
| total | Integer | 数据量 |
| data | List | 数据列表 |
| |─ | object | |
| |─createTime | String | UTC创建时间 "2026-01-01T00:00:00Z" |
| |─dbName | String | 资源库名称 |
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
7{
8 "result":"success",
9 "total":1,
10 "data": [
11 {
12 "createTime": "",
13 "dbName": ""
14 }
15 ]
16}
内容资源新增
接口描述
私有库新增内容资源数据
请求语法
JSON
1POST /api/v{version}/content/database/data/import HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| dbName | String | 是 | 数据库 |
| dataList | List | 数据列表 | |
| |─ | object | ||
| |─track_id | String | 是 | 内容资源id(同一个库内需要保持不重复) |
| |─name | String | 是 | 内容资源名称 |
| |─album_name | String | 是 | 专辑名称 |
| |─album_id | String | 否 | 专辑id |
| |─album_artist | String | 否 | 歌手/作者 |
| |─category_name | String | 否 | 类型(如,儿童、流行) |
| |─album_intro | String | 否 | 专辑介绍 |
| |─source | String | 否 | 来源 |
| |─episode | String | 否 | 集数(用于故事集、相声集) |
| |─play_link_url | String | 是 | 播放链接 |
| |─cover_url | Object | 否 | 歌曲图片 |
| |─|─small | String | 否 | 小图片 |
| |─|─middle | String | 否 | 中图片 |
| |─|─large | String | 否 | 大图片 |
请求示例
JSON
1POST /api/v1/content/database/data/import HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
6
7{
8 "dbName": "",
9 "dataList": [
10 {
11 "track_id": "",
12 "name": "",
13 "album_name": "",
14 "album_id": "",
15 "album_artist": "",
16 "category_name": "",
17 "album_intro": "",
18 "source": "",
19 "episode": "",
20 "play_link_url": "",
21 "cover_url": {
22 "small":"",
23 "middle":"",
24 "large":""
25 }
26 }
27 ]
28}
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| result | String | 操作结果 |
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
7{
8 "result": ""
9}
内容资源删除
接口描述
删除私有库内容资源数据
请求语法
JSON
1POST /api/v{version}/content/database/data/delete HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| dbName | String | 是 | 私有库名称 |
| dataList | array | 是 | 要删除的trackId列表(单次最多500个) |
请求示例
JSON
1POST /api/v1/content/database/data/delete HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
6
7{
8 "dbName": "content-1111",
9 "dataList":["id-1111","id-2222"]
10}
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| result | String | 操作结果 |
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
7{
8 "result": ""
9}
内容资源查询
接口描述
私有库内容资源查询(list)
请求语法
JSON
1POST /api/v{version}/content/database/data/list HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| dbName | String | 是 | 数据库名称 |
| cusor | String | 否 | 查询起始位置(trackId),查询游标后的数据;默认为空,空值默认从头查询 |
| limit | Interge | 否 | 返回数量(最大值为500,默认为50) |
| name | String | 否 | 资源名称 |
| albumName | String | 否 | 查询专辑名称 |
| albumArtist | String | 否 | 查询专辑作者 |
| trackId | String | 否 | 资源id |
请求示例
JSON
1POST /api/v1/content/database/data/list HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
6
7{
8 "dbName":"",
9 "limit": 10,
10 "cursor":"",
11 "name":"",
12 "albumName":"",
13 "albumArtist":"",
14 "trackId":""
15}
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| result | String | 操作结果 |
| total | Integer | 数据量 |
| cusor | String | 下次查询的起始位置(trackId),查询游标后的数据 |
| data | List | 操作结果 |
| |─ | object | |
| |─track_id | String | 是 |
| |─name | String | 是 |
| |─album_name | String | 是 |
| |─album_id | String | 否 |
| |─album_artist | String | 否 |
| |─category_name | String | 否 |
| |─album_intro | String | 否 |
| |─source | String | 否 |
| |─episode | String | 否 |
| |─play_link_url | String | 是 |
| |─cover_url | Object | 否 |
| |─|─small | String | 否 |
| |─|─middle | String | 否 |
| |─|─large | String | 否 |
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
7{
8 "result": "success",
9 "total": 26,
10 "data": [
11 {
12 "album_artist": "",
13 "album_id": "",
14 "album_intro": "",
15 "album_name": "",
16 "category_name": "",
17 "episode": "",
18 "id": "",
19 "if_used": true,
20 "name": "",
21 "play_link_url": "",
22 "source": "",
23 "track_id": "",
24 "cover_url": "cover_url": {
25 "small":"",
26 "middle":"",
27 "large":""
28 }
29 }
30 ],
31 "cursor": ""
32}
内容资源统计
接口描述
私有库数据统计
请求语法
JSON
1POST /api/v{version}/content/database/data/count HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| dbName | string | 是 |
请求示例
JSON
1POST /api/v1/content/database/data/count HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
6
7{
8 "dbName": ""
9}
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| count | Integer | 数据量 |
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
7{
8 "count": 0
9}
