Polyv Help Center

Help Center

Live Quiz - Get Passed User List by Question Set ID

Updated: 2022-05-16 10:08:41

Interface URL

http://api.polyv.net/live/v2/channels/{channelId}/qa-record
(注:{channelId}为频道号)

Interface Description

  1. Function: Retrieve the list of users who passed all questions under a channel's question set.
  2. The interface supports the HTTPS protocol.

Request Method

GET

Request Parameters

Parameter Required Type Description
appId Yes string Non-business parameter, obtained from API settings, the appid registered in the live system
sign Yes string Non-business parameter, signature, 32-character uppercase MD5 value
timestamp Yes string Current time in milliseconds (13 digits, valid for 3 minutes)
groupId Yes string String

Response Parameters

Parameter Description
status Response status
data Response result
code HTTP response status code
msg Error message
questionId Question ID
groupId Question set ID
channelId Channel ID
userId User ID
name Question name
type Question type: Single choice (R)
answer Answer: 1 2 3 4 5
openId WeChat Mini Program openId
unionId WeChat unionId
createdTime Creation time

Successful Response JSON Example

{
  code: 200,
  status: "success",
  message: "",
  data: [
      {
      questionId: "i6ro0hxj00",
      groupId: "i6ro0hxj00",	  
      channelId: 10001,
      userId: "i6ro0hxj00",
      name: "题目1",
      type: "R",	  
      answer: "1",
      openId: "1skkkkds",
      unionId: "1dfdkjfalksdfjaks",
      createdTime: "2018-01-22 00:00:00" 
    },
      {
      questionId: "i6ro0hxj00",
      groupId: "i6ro0hxj00",	  
      channelId: 10001,
      userId: "i6ro0hxj00",
      name: "题目1",
      type: "R",	  
      answer: "1",
      openId: "1skkkkds",
      unionId: "1dfdkjfalksdfjaks",
      createdTime: "2018-01-22 00:00:00" 
    }
  ]
}

Error Response JSON Example

{
  code: 400,
  status: "error",
  message: "invalid timestamp.",
  data: ""
}

PHP Request Example

<?php
  $channelId="89001";
  $groupId="1kdjihdhj";
  $appId="egzq0dunak";
  $appSecret="9018067824634261bd5733c6131ce35f";
  $timestamp = time()*1000;
  $str = $appSecret."appId".$appId."groupId$groupId".timestamp".$timestamp.$appSecret;
  $sign=strtoupper(md5($str));

  $url="http://api.polyv.net/live/v2/channels/$channelId/qa-questions?appId=".$appId."&timestamp=".$timestamp."&sign=".$sign."&groupId=".groupId;

  $ch = curl_init() or die ( curl_error() );
  curl_setopt( $ch, CURLOPT_URL, $url);
  curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
  $response = curl_exec ( $ch );
  curl_close ( $ch );
  echo $response;
?>

Signature Rules:

Sort non-empty request parameters alphabetically by parameter name, concatenate parameter names and values, prepend and append the appSecret, and generate a 32-character uppercase MD5 value as the sign. Example process:

1. Request parameters are: timestamp = 1488277559000 appId = "egzq0dunak" groupId = "jjksiiijjd"

2. Sort request parameters alphabetically by parameter name: appId = "egzq0dunak" groupId = "jjksiiijjd" timestamp = 1488277559000

3. Concatenate the string: Concatenate parameter names and values, prepend and append the appSecret (appSecret value is 9018067824634261bd5733c6131ce35f), as follows: 9018067824634261bd5733c6131ce35fappIdegzq0dunakgroupIdjjksiiijjdtimestamp14882779750009018067824634261bd5733c6131ce35f

4. Generate signature sign: 7D3C7E4DF08A952A9949C51E0F426782

联系客服,在线咨询