Live Quiz - Get All Quiz Sets Under a Channel
Interface URL
http://api.polyv.net/live/v2/channels/{channelId}/qa-groups
(Note: {channelId} is the channel ID)
Interface Description
1. Purpose: Retrieve the list of quiz sets under a channel.
2. The interface supports the HTTPS protocol.
Supported Format
JSON
Request Method
GET
Request Limit
TRUE
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | Yes | string | Non-business parameter, obtained from API settings, the appId registered in the live system |
| timestamp | Yes | string | Current time in milliseconds (13 digits, valid for 3 minutes) |
| channelId | Yes | string | Channel ID |
| sign | Yes | string | Verification signature, 32-character uppercase MD5 value |
Successful Response JSON Example:
{
"code": 200,
"status": "success",
"message": "",
"data": {
[
{
"groupId": "ab96d8f651",
"channelId": 10001,
"userId": "7d26575efe",
"name": "套题1",
"amount": 1000,
"awardUnit":"比特币",
"countDown": 10,
"status":"end"
"createdTime": "2018-01-22 00:00:00",
"lastModified": "2018-01-22 00:00:00",
"startTime": "2018-01-22 00:00:00"
},
{
"groupId": "ab96d8f651",
"channelId": 10001,
"userId": "7d26575efe",
"name": "套题1",
"amount": 1000,
"awardUnit":"比特币",
"countDown": 10,
"status":"end"
"createdTime": "2018-01-22 00:00:00",
"lastModified": "2018-01-22 00:00:00",
"startTime": "2018-01-22 00:00:00"
}
]
}
}
Field Description
| Parameter | Description |
|---|---|
| status | Response status |
| data | Response data |
| message | Error message |
| groupId | Quiz set ID |
| channelId | Live channel ID |
| userId | User ID |
| name | Quiz set name |
| amount | Reward amount |
| awardUnit | Reward unit |
| countDown | Time limit per question (in seconds) |
| status | Quiz set status: N (Not used), E (Ended), P (In progress) |
| createdTime | Creation time |
| lastModified | Last modified date |
| startTime | Quiz start time |
PHP Request Example
<?php
$appId = "epxt70r96u";
$timestamp = time()*1000;
$channelId = "124545";
$appSecret = "cb4a16edc2ef4f78941e00cd0b3bd867";
$str = $appSecret."appId$appId"."timestamp$timestamp".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://api.live.polyv.net/v2/channels/$channelId/qa-groups?";
echo file_get_contents($url."appId=$appId"."×tamp=$timestamp"."&sign=$sign");
?>
Signature Rules:
Arrange the request parameters in dictionary order by parameter name, concatenate the parameter name and value, prepend and append the appSecret, then generate a 32-character uppercase MD5 value as the sign. Example process below:
Request parameters: timestamp = "1494399085000" appId = "egymbtsf38"
Arrange request parameters in dictionary order: appId = "egymbtsf38" timestamp = "1494399085000"
Concatenate the string: concatenate parameter name and value, prepend and append the appSecret (here the appSecret value is 6ef8d34c08f44e91a18428842ff0ba7e), as follows: 6ef8d34c08f44e91a18428842ff0ba7eappIdegymbtsf38timestamp14943990850006ef8d34c08f44e91a18428842ff0ba7e
Generate the 32-character uppercase MD5 signature sign: 9291DE270E8C79FD4B805CDD45B6BC2B
