Query User Sub-Account List
API Description
1、查询用户子账号列表
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/user/children/list
<a href="/req.html?api=http://api.polyv.net/live/v4/user/children/list"" target="_blank">Online API Call
Request Method
GET
API Constraints
The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
The account must have the sub-account feature enabled.
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details: Get Secret Key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must never be saved or used directly on the client side. All APIs must be relayed through the customer's own server to call the POLYV server for response data. See details: Signature Generation Rules |
| pageNumber | false | Integer | Page number, defaults to 1 |
| pageSize | false | Integer | Number of items per page, defaults to 10, maximum cannot exceed 1000 |
| childEmail | false | String | Sub-account email(s), multiple emails separated by commas, up to 100 at a time |
Example
http://api.polyv.net/live/v4/user/children/list?pageNumber=1&appId=frlr1zazn3&sign=39B651B783ED46083BBBD85A6E312645&pageSize=20×tamp=1670548047976
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine the 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. For debugging and troubleshooting only, should not be tied to business logic |
| error | Object | Error information when status code is not 200 See details: Error Field Description |
| data | Object | Paginated response data See details: Data Field Description |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to identify the specific error cause |
| desc | String | Error description, corresponding to error.code |
Data Parameter Description
| Parameter | Type | Description |
|---|---|---|
| pageNumber | Integer | Current page number |
| pageSize | Integer | Number of items per page |
| totalPages | Long | Total number of pages |
| totalItems | Long | Total number of items |
| contents | Array | Current page content See details: Contents Field Description |
Contents Parameter Description
| Parameter | Type | Description |
|---|---|---|
| childUserId | String | Sub-account user ID |
| childName | String | Sub-account username |
| childEmail | String | Sub-account email |
| description | String | Description |
| telephone | String | Phone number |
| status | String | Status NORMAL: Normal FROZEN: Frozen DELETE: Deleted |
| organizationId | Integer | Organization structure ID |
| organizationName | String | Organization structure name |
| roleId | Integer | Role ID |
| roleName | String | Role name |
| createdTime | Long | Creation time, 13-digit millisecond timestamp |
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 integration. The Live Java SDK provides a unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
private final Logger log = LoggerFactory.getLogger(getClass());
/**
* 查询用户子账号列表
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void getUserChildrenListTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/user/children/list";
String pageNumber = "1";
String pageSize = "20";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("pageNumber", pageNumber);
requestMap.put("pageSize", pageSize);
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": "ea917b23a1114d82b16dd9ad4ae89b31.65.16704878229605481",
"data": {
"pageNumber": 1,
"pageSize": 10,
"totalPages": 1,
"totalItems": 1,
"contents": [
{
"childUserId": "837228485a48",
"childName": "张三",
"childEmail": "zhangsan@qq.com",
"description": "开拓测试产品市场,并努力建立测试领域内的相关标准和规范",
"telephone": "12300000000",
"status": "NORMAL",
"organizationId": 2743,
"organizationName": "测试部门",
"roleId": 397,
"roleName": "直播测试员",
"createdTime": 1670421414000
}
]
},
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"error": {
"code": 10003,
"desc": "时间戳过期"
},
"success": false
}
