https://api.polyv.net/live/v3/channel/questionnaire/detail-by-viewer
1、接口用于查询观众回答频道问卷详情
2、问卷ID可以从获取频道问卷列表中获取
3、接口支持https
{
"code": 200,
"status": "success",
"message": "",
"data": {
"questionnaireId": "fefg598lfj",
"customQuestionnaireId": "ddddxxx222",
"channelId": 108888,
"userId": "edvf2fpec9",
"name": "测试问卷_1564105496583",
"status": "forbidden",
"createdTime": 1564105498000,
"lastModified": 1564105498000,
"endTime": 1564105580000,
"questions": [
{
"questionId": "3839e04e78",
"channelId": 108888,
"userId": "edvf2fpec9",
"name": "您觉得课程怎么样",
"type": "C",
"option1": "好",
"option2": "很好",
"option3": "非常好",
"option4": "超级好",
"option5": "以上都对",
"createdTime": 1564105498000,
"lastModified": 1564105498000,
"answer": "",
"note": null,
"templateId": null,
"status": "draft",
"times": 0,
"tips1": null,
"tips2": null,
"tips3": null,
"tips4": null,
"tips5": null,
"required": "Y",
"scoreEnabled": "N",
"option6": "",
"option7": "",
"option8": "",
"option9": "",
"option10": "",
"score": null,
"itemType": 0,
"viewerId": "xsxxxxx",
"param4": "",
"param5": "",
"nickname": "aaa",
"recordAnswer": "C"
},
{
"questionId": "c908c81e80",
"channelId": 108888,
"userId": "edvf2fpec9",
"name": "今后还会不会来",
"type": "R",
"option1": "会",
"option2": "不会",
"option3": "",
"option4": "",
"option5": "",
"createdTime": 1564105498000,
"lastModified": 1564105498000,
"answer": "",
"note": null,
"templateId": null,
"status": "draft",
"times": 0,
"tips1": null,
"tips2": null,
"tips3": null,
"tips4": null,
"tips5": null,
"required": "Y",
"scoreEnabled": "N",
"option6": "",
"option7": "",
"option8": "",
"option9": "",
"option10": "",
"score": null,
"itemType": 0,
"viewerId": "xsxxxxx",
"param4": "",
"param5": "",
"nickname": "aaa",
"recordAnswer": "C"
}
]
}
}
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
{
"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": 400,
"data": "",
"message": "questionnaire is not exist",
"status": "error"
}
public static void test() {
String url = "https://api.polyv.net/live/v3/channel/questionnaire/detail-by-viewer";
// 用户对应的appId和加密串
String appId = "xxxxxxxxx";
String appSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
int channelId = 10001;
String questionnaireId = "xxxxx";
String viewerId = "xxxxx";
Map<String, String> params = new HashMap<>();
params.put("channelId", String.valueOf(channelId));
params.put("questionnaireId", questionnaireId);
params.put("viewerId", viewerId);
PolyvTool.setLiveSign(params, appId, appSecret);
// 调用Polyv的httpClient工具类发送请求
String content = HttpClientUtil.getInstance()
.sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
System.out.println(content);
}