Paginated Query of Whitelist
Updated: 2022-10-12 15:25:43
API Description
1、分页查询白名单
2、(channelId, timestamp, appId)参与sign签名,并和sign一起通过url传递
3、接口支持https协议
API URL
https://api.polyv.net/meet/v1/channel/auth-whitelist/get
Request Method
GET
API Constraints
- API calls are subject to rate limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See Obtaining Secret Key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value See Signature Generation Rules |
| channelId | true | Integer | Channel ID |
| pageNumber | false | Integer | Current page number, value between 1 and 1000; defaults to 1 if not provided |
| pageSize | false | Integer | Number of items per page, value between 1 and 1000; defaults to 10 if not provided |
Example
https://api.polyv.net/meet/v1/channel/auth-whitelist/get?appId=fyirmfdak4×tamp=1657786379352&sign=CEA301164F9BA5076F156C1EB60F22F8&channelId=2191532&pageNumber=3&pageSize=10
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine basic response status |
| status | String | Response result, determined by business logic; returns success on success, error on failure |
| success | Boolean | Whether the response was successful |
| requestId | String | Request ID, a unique UUID generated for each request, only for troubleshooting and debugging, not to be tied to business logic |
| error | Object | Error information when status code is not 200 See Error Field Description |
| data | Object | Failure reason, returned on failure. Empty on success See data Field Description |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to determine the specific error reason |
| desc | String | Error description, corresponding to error.code |
data Field Description
| Parameter | Type | Description |
|---|---|---|
| pageSize | Integer | Number of items per page, default 10, maximum 1000 |
| pageNumber | Integer | Current page number |
| totalItems | Integer | Total number of items |
| contents | Array | Query result list See Contents Parameter Description |
| totalPages | Integer | Total number of pages |
Contents Parameter Description
| Parameter | Type | Description |
|---|---|---|
| channelId | Integer | Channel ID |
| userId | String | Account ID |
| code | String | Membership code |
| name | String | Participant nickname |
| groupNo | Integer | Group sequence number |
| groupName | String | Group name |
| groupRole | String | Role within the group leader: Group leader member: Group member |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
It is strongly recommended to use the Live Java SDK for API functionality integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(WhitelistGet.class);
/**
* 分页查询白名单
* @throws IOException
*/
@Test
public void testWhitelistGet() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId=super.appId;
String appSecret=super.appSecret;
String userId = super.userId;
String timestamp=String.valueOf(System.currentTimeMillis());
//业务参数
String url = "https://api.polyv.net/meet/v1/channel/auth-whitelist/get";
String channelId = "2191532";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId",channelId);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试分页查询白名单接口返回值:{}",response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "9d87a0743cd741e2ad7100ee83459f64.62.16655593873260005",
"data": {
"pageNumber": 1,
"pageSize": 10,
"totalPages": 1,
"totalItems": 5,
"contents": [
{
"channelId": 2191532,
"userId": "1b448be323",
"code": "code1",
"name": "name1",
"groupNo": 1,
"groupName": "1组",
"groupRole": "leader"
},
{
"channelId": 2191532,
"userId": "1b448be323",
"code": "code2",
"name": "name2",
"groupNo": 1,
"groupName": "1组",
"groupRole": "member"
},
{
"channelId": 2191532,
"userId": "1b448be323",
"code": "11",
"name": "11",
"groupNo": 1,
"groupName": "1组",
"groupRole": "member"
},
{
"channelId": 2191532,
"userId": "1b448be323",
"code": "111",
"name": "name111",
"groupNo": 1,
"groupName": "1组",
"groupRole": "member"
},
{
"channelId": 2191532,
"userId": "1b448be323",
"code": "code3",
"name": "name3",
"groupNo": 2,
"groupName": "2组",
"groupRole": "member"
}
]
},
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"error": {
"code": 10003,
"desc": "时间戳过期"
},
"success": false
}
{
"code": 403,
"status": "error",
"error": {
"code": 10002,
"desc": "签名错误"
},
"success": false
}
{
"code": 400,
"status": "error",
"requestId": "9d87a0743cd741e2ad7100ee83459f64.59.16655595201740017",
"error": {
"code": 10001,
"desc": "单次查询不能大于1000条"
},
"data": null,
"success": false
}
