Live Quiz - Query WeChat User's Resurrection Card Count
Interface URL
http://api.polyv.net/live/v2/qa/revivecount
Interface Description
- Function: Get the live broadcast status of the channel
- The interface supports HTTPS protocol
Request Method
GET
Request Parameter Restrictions
true
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | Yes | string | Non-business parameter, obtained from API settings, the appId registered in the live broadcast system |
| timestamp | Yes | string | Current time in milliseconds (13 digits, valid for 3 minutes) |
| unionIds | Yes | string | Multiple WeChat account unionIds, separated by English commas |
| sign | Yes | string | Verification signature, 32-bit uppercase MD5 value |
Successful Response JSON Example:
{
"code": 200,
"status": "success",
"message": "",
"data": [
{
"unionId": "XXXXX",
"count": 10
},
{
"unionId": "XX",
"count": 20
}
]
}
Field Description
| Parameter | Description |
|---|---|
| status | Response status |
| data | Response result |
| message | Error message |
| unionId | WeChat user account unionId |
| count | Number of remaining resurrection cards for the user |
PHP Request Example
<?php
$appId = "epxt70r96u";
$timestamp = time()*1000;
$channelId = "124545";
$unionIds = "test1,test2";
$appSecret = "cb4a16edc2ef4f78941e00cd0b3bd867";
$str = $appSecret."appId$appId"."timestamp$timestamp"."unionIds$unionIds".$appSecret;
$sign = strtoupper(md5($str));
$url = "http://api.polyv.net/live/v2/qa/revivecount?";
echo file_get_contents($url."appId=$appId"."×tamp=$timestamp"."&unionIds=$unionIds"."&sign=$sign");
?>
Signature Rules:
Arrange the request parameters in dictionary order by parameter name, concatenate the parameter name and parameter value, and prepend and append the appSecret to generate a 32-bit uppercase MD5 value as the sign. The following is an example process:
Request parameters: timestamp = "1494399085000" appId = "egymbtsf38"
Arrange the request parameters in dictionary order by parameter name: appId = "egymbtsf38" timestamp = "1494399085000"
Concatenate the string: concatenate the parameter name and parameter value, and prepend and append the appSecret (here the appSecret value is 6ef8d34c08f44e91a18428842ff0ba7e), as follows: 6ef8d34c08f44e91a18428842ff0ba7eappIdegymbtsf38timestamp14943990850006ef8d34c08f44e91a18428842ff0ba7e
Generate the 32-bit uppercase MD5 signature sign: 9291DE270E8C79FD4B805CDD45B6BC2B
