获取多个频道的问卷列表
更新时间:2022-09-02 18:08:07
接口URL
https://api.polyv.net/live/v3/channel/questionnaire/list-mc
接口说明
1、接口用于获取多个频道的问卷列表,包括改已经提交数量
2、接口支持https
支持格式
JSON
请求方式
GET
请求参数
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| appId | 是 | string | 从API设置中获取,在直播系统登记的appId |
| timestamp | 是 | long | 当前13位毫秒级时间戳,3分钟内有效 |
| sign | 是 | String | 签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据【详见签名生成规则】 |
| channelIds | 是 | string | 频道号, 多个频道用英文逗号,隔开 |
| startTime | 否 | long | 查询的记录的开始时间,13位位毫秒级时间戳 |
| endTime | 否 | long | 查询的记录的结束时间,13位毫秒级时间戳 |
| page | 否 | int | 页号,默认为1 |
| pageSize | 否 | int | 每页条数,默认为10 |
注意:要按时间区间查询时,startTime 和 endTime 必须同时传参才能生效
响应成功JSON示例:
{
"code": 200,
"status": "success",
"message": "",
"data": {
"pageSize": 10,
"pageNumber": 1,
"totalItems": 2,
"contents": [
{
"questionnaireId": "fefg598lfj",
"channelId": 108888,
"userId": "edvf2fpec9",
"name": "测试问卷_1564105496583",
"status": "forbidden",
"createdTime": 1564105498000,
"lastModified": 1564105498000,
"endTime": 1564105580000,
"customQuestionnaireId": "xxxxxx",
"submitCount": 123
},
{
"questionnaireId": "fefg4s724k",
"channelId": 108888,
"userId": "edvf2fpec9",
"name": "测试问卷",
"status": "forbidden",
"createdTime": 1564105469000,
"lastModified": 1564105469000,
"endTime": 1564105487000,
"customQuestionnaireId": "xxxxxx",
"submitCount": 123
},
,
{
"questionnaireId": "fefg4s724j",
"channelId": 108887,
"userId": "edvf2fpec9",
"name": "测试问卷3",
"status": "forbidden",
"createdTime": 1564105469000,
"lastModified": 1564105469000,
"endTime": 1564105487000,
"customQuestionnaireId": "xxxxxx",
"submitCount": 123
}
],
"startRow": 1,
"firstPage": true,
"lastPage": true,
"nextPageNumber": 1,
"prePageNumber": 1,
"limit": 2,
"endRow": 2,
"totalPages": 1,
"offset": 0
}
}
响应失败JSON示例:
未输入appId
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
appId不正确
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
时间戳错误
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
签名错误
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
字段说明
| 参数名 | 说明 |
|---|---|
| code | 响应的状态码,例如:200 |
| status | 响应状态 |
| message | 异常错误信息 |
| data | 响应结果集 |
| pageNumber | 当前的页数 |
| totalItems | 总的条数 |
| contents | 查询的结果列表 |
| questionnaireId | 问卷ID |
| channelId | 频道ID |
| userId | 用户ID |
| name | 问卷名称 |
| status | 问卷状态,取值:saved(已保存),published (已发布),forbidden (问卷已完成填写) |
| createdTime | 问卷创建时间 |
| lastModified | 问卷最后修改时间 |
| endTime | 停止提交问卷时间 |
| customQuestionnaireId | 用户自定义问卷ID |
| submitCount | 问卷提交数量 |
| firstPage | 是否为第一页,值为:true/false |
| lastPage | 是否为最后一页,值为:true/false |
| nextPageNumber | 下一页编号 |
| prePageNumber | 上一页编号 |
| totalPages | 总页数 |
| startRow | 当前页第一个视频在回放视频中的位置 |
| endRow | 当前页最后一个视频在回放视频中的位置 |
| limit | 当前页视频个数 |
php请求示例
<?php
//引用config.php
include 'config.php';
$params = array(
'appId' => $appId,
'timestamp' => $timestamp,
'channelIds' => "108888"
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "https://api.polyv.net/live/v3/channel/questionnaire/list-mc?".http_build_query($params);
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_URL, $url);
$res = curl_exec($curl);
curl_close($curl);
echo $res;
?>
