Polyv Help Center

Help Center

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

  1. 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

  1. On a successful request, a LiveGetUserChildrenResponse object is returned. The B-end processes business logic based on this object.
  2. 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]].
  3. 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

Parameter Name Required Type Description
childEmail false String Sub-account email. Multiple email IDs separated by commas. Max 100 entries at a time.
currentPage false Integer Page number, defaults to 1 [Corresponds to pageNumber field in API documentation]
pageSize false Integer Number of data items per page, defaults to 20.
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).

Return Object Description

Parameter Name Type Description
contents Array Sub-account information [See UserChildren Parameter Description]
pageSize Integer Number of data items per page, defaults to 20.
currentPage Integer Current page [Corresponds to pageNumber field in API documentation]
totalItems Integer Total number of records.
totalPage Integer Total number of pages [Corresponds to totalPages field in API documentation]
UserChildren Parameter Description
Parameter Name 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, FROZEN, DELETE.
organizationId Integer User's organization structure ID.
organizationName String User's organization structure name.
roleId Integer Role ID.
roleName String Role name.
createdTime Date Creation time, 13-digit millisecond timestamp.






2. Add Sub-account

Description

新增子账号
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/children/create

Call Constraints

  1. 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

  1. On a successful request, a LiveCreateUserChildrenResponse object is returned. The B-end processes business logic based on this object.
  2. 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]].
  3. 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

Parameter Name Required Type Description
childEmail true String Sub-account login email.
childName true String Sub-account username, max 50 characters.
password true String Sub-account password, 8-16 characters, must contain letters and numbers.
roleId true Integer Role ID.
organizationId false Integer Organization ID. If not provided, defaults to the root organization: Headquarters.
telephone false String Phone number.
description false String Remarks, max 100 characters.
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).

Return Object Description

Parameter Name 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, FROZEN, DELETE.
organizationId Integer User's organization structure ID.
organizationName String User's organization structure name.
roleId Integer Role ID.
roleName String Role name.
createdTime Date Creation time.






3. Modify Sub-account

Description

通过子账号登录邮箱修改子账号信息
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/children/update

Call Constraints

  1. 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

  1. On a successful request, a Boolean object is returned. The B-end processes business logic based on this object.
  2. 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]].
  3. 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

Parameter Name Required Type Description
childEmail true String Sub-account login email.
childName false String Sub-account username, max 50 characters.
password false String Sub-account password, 8-16 characters, must contain letters and numbers.
roleId false Integer Role ID.
telephone false String Phone number.
description false String Remarks, max 100 characters.
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).

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

  1. 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

  1. On a successful request, a Boolean object is returned. The B-end processes business logic based on this object.
  2. 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]].
  3. 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

Parameter Name Required Type Description
childEmail true String Sub-account email.
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).

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

  1. 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

  1. On a successful request, a LiveGetChildrenRoleListResponse object is returned. The B-end processes business logic based on this object.
  2. 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]].
  3. 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

Parameter Name Required Type Description
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).

Return Object Description

The return object is List<LiveGetChildrenRoleListResponse>. The specific elements of LiveGetChildrenRoleListResponse are as follows:

Parameter Name Type Description
id Integer Role ID.
name String Role name.
description String Role description, remarks.
permissionName String Permission names, multiple names separated by commas.






6. Query Organization Structure List

Description

组织架构列表
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/organization/list

Call Constraints

  1. 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

  1. On a successful request, a LiveGetOrganizationListResponse object is returned. The B-end processes business logic based on this object.
  2. 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]].
  3. 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

Parameter Name Required Type Description
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).

Return Object Description

The return object is List<LiveGetOrganizationListResponse>. The specific elements of LiveGetOrganizationListResponse are as follows:

Parameter Name Type Description
userId String User ID.
id Integer Organization ID.
name String Organization name.
description String Organization description.
icon String Icon.
lft Integer Left node.
rgt Integer Right node.
parentId Integer Left node ID of the parent organization.






7. Add Organization

Description

组织架构新增子节点(排在第一位)
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/organization/create

Call Constraints

  1. 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

  1. On a successful request, a LiveCreateOrganizationResponse object is returned. The B-end processes business logic based on this object.
  2. 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]].
  3. 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

Parameter Name Required Type Description
parentId true Integer Parent node organization ID.
name true String Organization structure name, max 12 characters.
description false String Organization description, max 100 characters.
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtained by registering on the Polyv official website: Official Website -> Login -> Live (Development Settings).

Return Object Description

Parameter Name Type Description
userId String User ID.
id Integer Organization ID.
name String Organization name.
description String Organization description.
icon String Icon.
lft Integer Left node.
rgt Integer Right node.
parentId Integer Left node ID of the parent organization.






8. Delete Organization

Description

通过组织ID删除组织
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/organization/delete

Call Constraints

  1. API
联系客服,在线咨询