childrenService
Updated: 2025-09-11 15:18:09
1. Query Sub-account List
Description
查询用户子账号列表
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/children/list
Call Constraints
- API calls are rate-limited. Click for details. For common call exceptions, click here.
Unit Test
@Test
public void testGetUserChildren() throws IOException, NoSuchAlgorithmException {
LiveGetUserChildrenRequest liveGetUserChildrenRequest = new LiveGetUserChildrenRequest();
LiveGetUserChildrenResponse liveGetUserChildrenResponse;
try {
liveGetUserChildrenRequest.setChildEmail("");
liveGetUserChildrenResponse = new ILiveChildrenServiceImpl().getUserChildren(liveGetUserChildrenRequest);
Assert.assertNotNull(liveGetUserChildrenResponse);
if (liveGetUserChildrenResponse != null) {
//to do something ......
log.debug("测试查询用户子账号列表成功 {}", JSON.toJSONString(liveGetUserChildrenResponse));
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
Unit Test Description
- On a successful request, a
LiveGetUserChildrenResponse object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty]].
- If a server processing error occurs, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request data, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature.]
Request Parameter Description
Return Object Description
2. Add Sub-account
Description
新增子账号
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/children/create
Call Constraints
- API calls are rate-limited. Click for details. For common call exceptions, click here.
Unit Test
@Test
public void testCreateUserChildren() throws IOException, NoSuchAlgorithmException {
LiveCreateUserChildrenRequest liveCreateUserChildrenRequest = new LiveCreateUserChildrenRequest();
LiveCreateUserChildrenResponse liveCreateUserChildrenResponse;
try {
liveCreateUserChildrenRequest.setChildEmail(getRandomString(6) + "-paas-test@polyv.net")
.setChildName(getRandomString(6))
.setPassword(getRandomString(8))
.setRoleId(1);
liveCreateUserChildrenResponse = new ILiveChildrenServiceImpl().createUserChildren(
liveCreateUserChildrenRequest);
Assert.assertNotNull(liveCreateUserChildrenResponse);
if (liveCreateUserChildrenResponse != null) {
//to do something ......
log.debug("测试新增子账号成功 {}", JSON.toJSONString(liveCreateUserChildrenResponse));
//TODO 此处创建完成后删除了子账号,正式使用需删除该语句
super.deleteUserChildren(liveCreateUserChildrenResponse.getChildEmail());
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
Unit Test Description
- On a successful request, a
LiveCreateUserChildrenResponse object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty]].
- If a server processing error occurs, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request data, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature.]
Request Parameter Description
Return Object Description
3. Modify Sub-account
Description
通过子账号登录邮箱修改子账号信息
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/children/update
Call Constraints
- API calls are rate-limited. Click for details. For common call exceptions, click here.
Unit Test
@Test
public void testUpdateUserChildren() throws IOException, NoSuchAlgorithmException {
LiveUpdateUserChildrenRequest liveUpdateUserChildrenRequest = new LiveUpdateUserChildrenRequest();
Boolean liveUpdateUserChildrenResponse;
try {
liveUpdateUserChildrenRequest.setChildEmail(super.getUserChildren().getChildEmail())
.setChildName("张三zs")
.setDescription("测试修改描述");
liveUpdateUserChildrenResponse = new ILiveChildrenServiceImpl().updateUserChildren(
liveUpdateUserChildrenRequest);
Assert.assertTrue(liveUpdateUserChildrenResponse);
if (liveUpdateUserChildrenResponse) {
//to do something ......
log.debug("测试修改子账号成功");
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
Unit Test Description
- On a successful request, a
Boolean object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty]].
- If a server processing error occurs, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request data, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature.]
Request Parameter Description
Return Object Description
Entity returned for modifying a sub-account.
4. Delete Sub-account
Description
通过子账号登录邮箱删除子账号
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/children/delete
Call Constraints
- API calls are rate-limited. Click for details. For common call exceptions, click here.
Unit Test
@Test
public void testDeleteUserChildren() throws IOException, NoSuchAlgorithmException {
LiveDeleteUserChildrenRequest liveDeleteUserChildrenRequest = new LiveDeleteUserChildrenRequest();
Boolean liveDeleteUserChildrenResponse;
try {
liveDeleteUserChildrenRequest.setChildEmail(super.getUserChildren().getChildEmail());
liveDeleteUserChildrenResponse = new ILiveChildrenServiceImpl().deleteUserChildren(
liveDeleteUserChildrenRequest);
Assert.assertTrue(liveDeleteUserChildrenResponse);
if (liveDeleteUserChildrenResponse) {
//to do something ......
log.debug("测试删除子账号成功");
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
Unit Test Description
- On a successful request, a
Boolean object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty]].
- If a server processing error occurs, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request data, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature.]
Request Parameter Description
Return Object Description
Entity returned for deleting a sub-account.
5. Query Role List
Description
查询子账号角色权限列表
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/children/role/list
Call Constraints
- API calls are rate-limited. Click for details. For common call exceptions, click here.
Unit Test
@Test
public void testGetChildrenRoleList() throws IOException, NoSuchAlgorithmException {
LiveGetChildrenRoleListRequest liveGetChildrenRoleListRequest = new LiveGetChildrenRoleListRequest();
List<LiveGetChildrenRoleListResponse> liveGetChildrenRoleListResponse;
try {
liveGetChildrenRoleListResponse = new ILiveChildrenServiceImpl().getChildrenRoleList(
liveGetChildrenRoleListRequest);
Assert.assertNotNull(liveGetChildrenRoleListResponse);
if (liveGetChildrenRoleListResponse != null) {
//to do something ......
log.debug("测试查询角色列表成功 {}", JSON.toJSONString(liveGetChildrenRoleListResponse));
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
Unit Test Description
- On a successful request, a
LiveGetChildrenRoleListResponse object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty]].
- If a server processing error occurs, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request data, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature.]
Request Parameter Description
Return Object Description
The return object is List<LiveGetChildrenRoleListResponse>. The specific elements of LiveGetChildrenRoleListResponse are as follows:
6. Query Organization Structure List
Description
组织架构列表
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/organization/list
Call Constraints
- API calls are rate-limited. Click for details. For common call exceptions, click here.
Unit Test
@Test
public void testGetOrganizationList() throws IOException, NoSuchAlgorithmException {
LiveGetOrganizationListRequest liveGetOrganizationListRequest = new LiveGetOrganizationListRequest();
List<LiveGetOrganizationListResponse> liveGetOrganizationListResponse;
try {
liveGetOrganizationListResponse = new ILiveChildrenServiceImpl().getOrganizationList(
liveGetOrganizationListRequest);
Assert.assertNotNull(liveGetOrganizationListResponse);
if (liveGetOrganizationListResponse != null) {
//to do something ......
log.debug("测试查询组织架构列表成功 {}", JSON.toJSONString(liveGetOrganizationListResponse));
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
Unit Test Description
- On a successful request, a
LiveGetOrganizationListResponse object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty]].
- If a server processing error occurs, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request data, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature.]
Request Parameter Description
Return Object Description
The return object is List<LiveGetOrganizationListResponse>. The specific elements of LiveGetOrganizationListResponse are as follows:
7. Add Organization
Description
组织架构新增子节点(排在第一位)
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/organization/create
Call Constraints
- API calls are rate-limited. Click for details. For common call exceptions, click here.
Unit Test
@Test
public void testCreateOrganization() throws IOException, NoSuchAlgorithmException {
LiveCreateOrganizationRequest liveCreateOrganizationRequest = new LiveCreateOrganizationRequest();
LiveCreateOrganizationResponse liveCreateOrganizationResponse;
try {
liveCreateOrganizationRequest.setParentId(573).setName("测试组织001").setDescription("测试描述");
liveCreateOrganizationResponse = new ILiveChildrenServiceImpl().createOrganization(
liveCreateOrganizationRequest);
Assert.assertNotNull(liveCreateOrganizationResponse);
if (liveCreateOrganizationResponse != null) {
//to do something ......
log.debug("测试新增组织成功 {}", JSON.toJSONString(liveCreateOrganizationResponse));
//TODO 此处创建完成后删除了组织,正式使用需删除该语句
super.deleteOrganization(liveCreateOrganizationResponse.getId());
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
Unit Test Description
- On a successful request, a
LiveCreateOrganizationResponse object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty]].
- If a server processing error occurs, a
PloyvSdkException is thrown. The error message is available via PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request data, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature.]
Request Parameter Description
Return Object Description
8. Delete Organization
Description
通过组织ID删除组织
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/organization/delete
Call Constraints
- API