1、查询频道问卷题目与结果
2、问卷ID可以从获取频道问卷列表中获取
3、接口支持https协议
http://api.polyv.net/live/v3/channel/questionnaire/detail
https://api.polyv.net/live/v3/channel/questionnaire/detail?appId=frlr1zazn3&sign=21B0DC009E318AA78636A7CE9C622056&questionnaireId=fwndt7vq4x&channelId=1965681×tamp=1621845043008
private static final Logger log = LoggerFactory.getLogger(LiveInteractionTest.class);
/**
* 查询频道问卷题目与结果
* @throws IOException
*/
@Test
public void testGetQuestionnaireDetail() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId=super.appId;
String appSecret=super.appSecret;
String userId = super.userId;
String timestamp=String.valueOf(System.currentTimeMillis());
//业务参数
String channelId = "1965681";
String questionnaireId = "fwndt7vq4x";
String url = "http://api.polyv.net/live/v3/channel/questionnaire/detail";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId",channelId);
requestMap.put("questionnaireId",questionnaireId);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url,requestMap);
log.info("测试查询频道问卷题目与结果接口返回值:{}",response);
//do somethings
}
{
"code": 200,
"status": "success",
"message": "",
"data": {
"questionnaireId": "fwndt7vq4x",
"channelId": 1965681,
"userId": "1b448be323",
"name": "测试试卷,明天会更好调查2 (1175)",
"status": "saved",
"createdTime": 1615507307000,
"lastModified": 1615507307000,
"endTime": null,
"customQuestionnaireId": "30231311ed334a7f80e4db520b3bec99",
"questions": [{
"questionId": "4bb657cc5897451ea4705a9bb843e16c",
"channelId": 1965681,
"userId": "1b448be323",
"name": "您的兴趣爱好?",
"type": "C",
"option1": "篮球",
"option2": "足球",
"option3": "排球",
"option4": "跑步",
"option5": "羽毛球",
"createdTime": 1615507307000,
"lastModified": 1615507307000,
"answer": "a",
"note": null,
"templateId": null,
"status": "draft",
"times": 0,
"tips1": null,
"tips2": null,
"tips3": null,
"tips4": null,
"tips5": null,
"required": "Y",
"scoreEnabled": "Y",
"option6": null,
"option7": null,
"option8": null,
"option9": null,
"option10": null,
"score": 20,
"itemType": 0,
"option11": null,
"option12": null,
"option13": null,
"option14": null,
"option15": null
}, {
"questionId": "b5b33c428cfd488eb8f4c5991e4e9aff",
"channelId": 1965681,
"userId": "1b448be323",
"name": "您的性别",
"type": "R",
"option1": "M",
"option2": "W",
"option3": null,
"option4": null,
"option5": null,
"createdTime": 1615507307000,
"lastModified": 1615507307000,
"answer": "",
"note": null,
"templateId": null,
"status": "draft",
"times": 0,
"tips1": null,
"tips2": null,
"tips3": null,
"tips4": null,
"tips5": null,
"required": "Y",
"scoreEnabled": "N",
"option6": null,
"option7": null,
"option8": null,
"option9": null,
"option10": null,
"score": null,
"itemType": 0,
"option11": null,
"option12": null,
"option13": null,
"option14": null,
"option15": null
}, {
"questionId": "cc4b8c4c44d346bcab4bb47e3dca275d",
"channelId": 1965681,
"userId": "1b448be323",
"name": "您的职务?",
"type": "Q",
"option1": "",
"option2": null,
"option3": null,
"option4": null,
"option5": null,
"createdTime": 1615507307000,
"lastModified": 1615507307000,
"answer": "",
"note": null,
"templateId": null,
"status": "draft",
"times": 0,
"tips1": null,
"tips2": null,
"tips3": null,
"tips4": null,
"tips5": null,
"required": "Y",
"scoreEnabled": "N",
"option6": null,
"option7": null,
"option8": null,
"option9": null,
"option10": null,
"score": null,
"itemType": 0,
"option11": null,
"option12": null,
"option13": null,
"option14": null,
"option15": null
}]
}
}
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}