语音文件管理 - 获取语音文件
接口说明
获取语音文件列表。
请求方式
POST,form-data格式
请求参数
| 参数名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
| service | string | 是 | App.Sip_Voice.GetAudioList |
| token | string | 是 | 通过授权接口获取的token |
| filename | string | 否 | 文件名 |
| voicename | string | 否 | 语音名称,支持模糊查询 |
| status | int | 否 | 0:启用、1:禁用、2:全部 |
| currentpage | int | 否 | 页数,默认:1 |
| itemsperpage | int | 否 | 每页数量,默认:10,最小:1;最大:1000 |
接口请求示例(PHP)
<?php
$apiUrl = 'http://127.0.0.1:8080';
$postFields = [
'service' => 'App.Sip_Cdr.GetBill',
'token' => 'ABCDEFG',
'starttime' => '2019-01-12 00:00:00',
'endtime' => '2020-12-12 00:00:00',
'direction' => 3
'syncflag' => 3,
'callmethod' => 0,
'currentpage' => 1,
'itemsperpage' => 10,
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $apiUrl);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($curl);
$curlError = curl_error($curl);
curl_close($curl);
var_dump($response);
?>
返回数据结构示例
{
"ret": 200,
"data": {
"status": 0,
"desc": "success",
"result": {
"totalitems": 4,
"currentpage": 1,
"itemsperpage": 20,
"audios": [
{
"id": 1897,
"createtime": "2026-09-09 11:32:59",
"updatetime": "2026-09-09 11:32:59",
"status": 0,
"filename": "welcome.mp3",
"voicename": "欢迎语音",
"mark": null
},
{
"id": 32,
"createtime": "2020-04-05 12:24:32",
"updatetime": "2020-04-05 12:24:32",
"status": 0,
"filename": "162729test_Telat3hari.mp3",
"voicename": "test",
"mark": null
},
{
"id": 30,
"createtime": "2020-04-05 12:24:32",
"updatetime": "2020-04-05 12:24:32",
"status": 0,
"filename": "d0bc00b05d3e.mp3",
"voicename": "apply_pass_voice2",
"mark": null
},
{
"id": 6,
"createtime": "2020-04-05 12:24:32",
"updatetime": "2020-04-05 12:24:32",
"status": 0,
"filename": "pylv8-favv2.mp3",
"voicename": "apply_pass_voice",
"mark": null
}
]
},
"reqtime": 1788924914,
"rsptime": 1788924914
},
"msg": ""
}
返回参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| result | objest | 返回的结果集 |
| —totalitems | int | 记录总数 |
| —currentpage | int | 当前页码 |
| —itemsperpage | int | 每页数量 |
| —audios | array | 记录数组 |
| ——id | int | 记录id |
| ——filename | string | 文件名 |
| ——voicename | string | 语音文件名称 |
| ——mark | string | 备注说明 |
| ——status | string | 状态 |
| ——createtime | string | 创建时间 |
| ——updatetime | string | 更新时间 |