外观
语音文件
接口说明
调用接口可对语音库内音频进行管理,包括增、删、查。
1.上传
请求示例
json
{
"name": "等待音",
"fileUrl": "https://example.com/xxx.wav",
"fileType": "wav",
"fileName": "xxx.wav",
"description": ""
}字段说明
| 字段 | 说明 |
|---|---|
name | 名称 |
fileUrl | 文件url |
fileType | 文件类型(wav/mp3) |
请求方式
POST/call/web/v1/voice/upload
请求参数
| 参数 | 类型 | 必填 | 示例值 | 说明 |
|---|---|---|---|---|
| name | string | 是 | 等待音 | 名称 |
| fileUrl | string | 是 | https://example.com/xxx.wav | 文件url |
| fileType | string | 是 | wav | 文件类型 |
| fileName | string | 是 | xxx.wav | 文件名 |
| description | string | 否 | — | 备注 |
成功响应
json
{
"success": true,
"message": "200 ok!",
"code": "200",
"data": {
"id": "",
"accountId": "",
"name": "等待音",
"fileType": "wav",
"description": "测试上传",
"del": false,
"status": "pass",
"fileUrl": "https://example.com/xxx.wav",
"fileName": "xxx.wav"
}
}2.查询
请求示例
json
{
"name": "test",
"ids": [
"id1",
"id2"
],
"page": 1,
"pageSize": 10
}请求方式
POST/call/web/v1/voice/query
请求参数
| 参数 | 类型 | 必填 | 示例值 | 说明 |
|---|---|---|---|---|
| name | string | 否 | test | 名称 |
| ids | stringlist | 否 | — | id列表 |
| page | integer | 否 | 1 | 页码 |
| pageSize | integer | 否 | 10 | 每页数量 |
成功响应
json
{
"success": true,
"message": "200 ok!",
"code": "200",
"data": {
"list": [
{
"id": "",
"accountId": "",
"name": "",
"fileType": "wav",
"description": "测试上传",
"del": false,
"status": "pass",
"fileUrl": "https://example.com/xxx.wav",
"fileName": "xxx.wav"
}
],
"page": 1,
"pageSize": 10,
"count": 1,
"total": 1,
"totalPage": 1
}
}3.删除
请求示例
json
[
"id1",
"id2",
"id3"
]请求方式
POST/call/web/v1/voice/delete
成功响应
json
{
"success": true,
"message": "200 ok!",
"code": "200",
"data": null
}