Polyv Help Center

Help Center

channelService

Updated: 2024-04-22 19:18:32

1. Create Seminar Channel (Legacy Backend)

Description

创建频道并进行相关设置
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/basic/create

Call Constraints

  1. The API call has a frequency limit. See details. For common call exceptions, see details.

Unit Testing

    @Test
    public void testCreateChannel() throws IOException, NoSuchAlgorithmException {
        SeminarCreateChannelRequest seminarCreateChannelRequest = new SeminarCreateChannelRequest();
        SeminarCreateChannelResponse seminarCreateChannelResponse;
        try {
            SeminarCreateChannelRequest.BasicSetting basicSetting = new SeminarCreateChannelRequest.BasicSetting();
            basicSetting.setName("测试SDK创建研讨会")
                    .setChannelPasswd(super.getRandomString(6))
                    .setCategoryId(super.getCategory());
            SeminarCreateChannelRequest.AuthSetting authSetting = new SeminarCreateChannelRequest.AuthSetting();
            authSetting.setRank(1)
                    .setEnabled(SeminarConstant.Flag.YES.getFlag())
                    .setAuthType(SeminarConstant.AuthType.CODE.getCode())
                    .setAuthCode("123");
            seminarCreateChannelRequest.setBasicSetting(basicSetting).setAuthSettings(Arrays.asList(authSetting));
            seminarCreateChannelResponse = new SeminarChannelServiceImpl().createChannel(seminarCreateChannelRequest);
            Assert.assertNotNull(seminarCreateChannelResponse);
            if (seminarCreateChannelResponse != null) {
                //to do something ......
                log.debug("测试创建研讨会频道(旧版后台)成功 {}", JSON.toJSONString(seminarCreateChannelResponse));
                //TODO 此处创建完成后删除了频道,正式使用需删除该语句
                super.deleteChannel(seminarCreateChannelResponse.getChannelId());
            }
        } 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 Testing Instructions

  1. If the request is correct, return a SeminarCreateChannelResponse object, based on which the B-side handles the business logic.

  2. If request parameter validation fails, a PloyvSdkException is thrown. The error message can be found via PloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]

  3. The server encountered an exception and threw a PloyvSdkException. For error details, see PloyvSdkException.getMessage(), e.g., [ Polyv request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Name Required Type Description
basicSetting true BasicSetting Basic settings [see BasicSetting parameter description]
authSettings false Array Viewing condition settings [see AuthSetting parameter description]
BasicSetting Parameter Description
Parameter Required Type Description
name true String Channel name
channelPasswd true String Channel password (can be used with the channel number to log in to the channel). Length must not exceed 16 characters and must contain both letters and numbers.
categoryId false Integer Category of the new channel. If not provided, the default category will be used (category ID can be obtained via the "Query Live Categories" API).
coverImg false String Cover image URL
likes false Long Number of likes
pageView false Long Cumulative number of views
subAccount false String Sub-account email. When filled, the channel will be created under this sub-account (the sub-account cannot be deleted or disabled). Currently, it cannot be retrieved via the API.
AuthSetting Parameter Description
Parameter Required Type Description
rank true Integer Primary viewing condition is 1, secondary viewing condition is 2
enabled true String Whether to enable conditional viewing: N (disabled), Y (enabled)
authType false String pay: paid viewing, code: verification code viewing, phone: whitelist viewing, info: registration viewing, custom: custom authorization viewing, external: external authorization viewing, direct: independent authorization viewing
payAuthTips false String When authType is pay, this parameter is required. Welcome message title
price false Float When authType is pay, this parameter is required. Price, in yuan
watchEndTime false Date When authType is pay, this parameter is optional. Paid validity expiration date
validTimePeriod false Integer When authType is pay, this parameter is optional. Paid validity duration, in days. When both watchEndTime and validTimePeriod are empty, it means the payment is valid permanently
authCode false String When authType is code, this parameter is required. Verification code
qcodeTips false String When authType is code, this parameter is optional. Prompt text
qcodeImg false String When authType is code, this parameter is optional. QR code URL of the official account
authTips false String When authType is phone, this parameter is optional. Prompt text
infoFields false Array When authType is info, this parameter is required. Registration viewing information, maximum of 5 items [See InfoField Parameter Description]
externalKey false String When authType is external, this parameter is required. SecretKey
externalUri false String When authType is external, this parameter is required. Custom URL
externalRedirectUri false String When authType is external, this parameter is optional. Redirect URL
customKey false String When authType is custom, this parameter is required. SecretKey
customUri false String When authType is custom, this parameter is required. Custom URL
directKey false String When authType is direct, this parameter is required. Independent authorization SecretKey
InfoField Parameter Description
Parameter Required Type Description
name false String Registration field name, up to 8 characters
type true String Registration type: name - name, text - text, mobile - mobile number, number - number, option - dropdown option. This field is required when registering for viewing.
options false String Dropdown option values, separated by commas. Maximum of 8 options; each option up to 8 characters.
placeholder false String Input field placeholder text, up to 8 characters
sms false String SMS verification toggle: Y for enabled, N for disabled

Return Object Description

Parameter Name Type Description
channelId String Live channel ID
userId String POLYV user ID, consistent with the one on the Polyv official website. Retrieval path: Official website -> Login -> Live Streaming (Developer Settings)
name String Live channel name
publisher String Host
description String Live channel description
scene String Live streaming scenario: seminar
channelPasswd String Channel password
currentTimeMillis Date Current time






2. Create a Seminar Channel (New Backend)

Description

根据直播默认模板创建频道
接口地址(仅做说明使用):https://api.polyv.net/live/v4/channel/create

Call Constraints

  1. The API call is subject to rate limits. For details, please refer to [/seminar/java/limit.md]. For common call exceptions, please refer to [/seminar/java/exceptionDoc].

Unit Testing

    @Test
    public void testCreateChannelV2() throws IOException, NoSuchAlgorithmException {
        SeminarCreateChannelV2Request seminarCreateChannelV2Request = new SeminarCreateChannelV2Request();
        SeminarCreateChannelV2Response seminarCreateChannelV2Response;
        try {
            seminarCreateChannelV2Request.setName("测试SDK创建研讨会")
                    .setSeminarHostPassword(super.getRandomString(6))
                    .setSeminarAttendeePassword(super.getRandomString(8))
                    .setCategoryId(super.getCategory())
                    .setStartTime(super.getDate(System.currentTimeMillis() + 600 * 1000))
                    .setLinkMicLimit(15);
            seminarCreateChannelV2Response = new SeminarChannelServiceImpl().createChannelV2(
                    seminarCreateChannelV2Request);
            Assert.assertNotNull(seminarCreateChannelV2Response);
            if (seminarCreateChannelV2Response != null) {
                //to do something ......
                log.debug("测试创建研讨会频道(新版后台)成功 {}", JSON.toJSONString(seminarCreateChannelV2Response));
                //TODO 此处创建完成后删除了频道,正式使用需删除该语句
                super.deleteChannel(String.valueOf(seminarCreateChannelV2Response.getChannelId()));
            }
        } 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 Testing Instructions

  1. If the request is correct, return a SeminarCreateChannelV2Response object, and the B-side processes the business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]

  3. The server encountered an exception and threw a PloyvSdkException. For error details, see PloyvSdkException.getMessage(), e.g., [ Polyv request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
name true String Live stream name, maximum length 100
seminarHostPassword false String Seminar host password, only valid when the live stream scenario is a seminar. Length 6-16 characters. If not provided, it will be randomly generated by the system. The host password and attendee password must be different.
seminarAttendeePassword false String Seminar attendee password, only valid when the live stream scenario is a seminar. Length 6-16 characters. If not provided, it will be randomly generated by the system. The host password and attendee password must be different.
splashImg false String Splash image URL. For images not hosted under the Polyv domain, upload them first via Upload Image Resource
categoryId false Integer Category ID, obtainable via the "Query Live Stream Categories" API
startTime false Date Start time
subAccount false String Sub-account email. If provided, the channel will be created under this sub-account (the sub-account must not be deleted or disabled). Currently cannot be retrieved via API.
linkMicLimit false Integer Number of participants 1-47: indicates the number of participants

Return Object Description

Parameter Name Type Description
channelId String Channel ID
userId String POLYV user ID, consistent with the one on the Polyv official website. Retrieval path: Official website -> Login -> Live Streaming (Development Settings)
seminarHostPassword String Seminar host password, only non-null when the live streaming scenario is a seminar, length 6-16 characters
seminarAttendeePassword String Seminar attendee password, only non-null when the live streaming scenario is a seminar, length 6-16 characters






3. Get Webinar Channel Recording Settings

Description

获取研讨会频道录制设置
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/seminar/setting/get-record

Call Constraints

  1. API calls are subject to rate limits. For details, see here. For common call exceptions, see here.

Unit Testing

    @Test
    public void testGetRecordSetting() throws IOException, NoSuchAlgorithmException {
        SeminarGetRecordSettingRequest seminarGetRecordSettingRequest = new SeminarGetRecordSettingRequest();
        SeminarGetRecordSettingResponse seminarGetRecordSettingResponse;
        try {
            String channelId = super.getChannelId();
            seminarGetRecordSettingRequest.setChannelId(channelId);
            seminarGetRecordSettingResponse = new SeminarChannelServiceImpl().getRecordSetting(
                    seminarGetRecordSettingRequest);
            Assert.assertNotNull(seminarGetRecordSettingResponse);
            if (seminarGetRecordSettingResponse != null) {
                //to do something ......
                log.debug("测试获取研讨会频道录制设置成功 {}", JSON.toJSONString(seminarGetRecordSettingResponse));
            }
        } 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 Testing Instructions

  1. If the request is correct, return a SeminarGetRecordSettingResponse object, based on which the B-side processes business logic.

  2. If request parameter validation fails, a PloyvSdkException is thrown. The error message can be found via PloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]

  3. The server encountered an exception and threw a PloyvSdkException. For error details, refer to PloyvSdkException.getMessage(), e.g., [ Polyv request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID

Return Object Description

Parameter Name Type Description
enabled String Recording switch: Y for enabled, N for disabled
mode String Recording mode: auto for automatic, manual for manual
channelId String Live channel ID
userId String POLYV user ID, obtained by registering on the Polyv official website. Path: Official website -> Login -> Live Streaming (Developer Settings)
resolution String Resolution






4. Modify Seminar Channel Recording Settings

Description

修改研讨会频道录制设置
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/seminar/setting/set-record

Call Constraints

  1. The API call has a frequency limit. For details, see here. For common call exceptions, see here.

Unit Testing

    @Test
    public void testSetRecordSetting() throws IOException, NoSuchAlgorithmException {
        SeminarSetRecordSettingRequest seminarSetRecordSettingRequest = new SeminarSetRecordSettingRequest();
        Boolean seminarSetRecordSettingResponse;
        try {
            String channelId = super.getChannelId();
            seminarSetRecordSettingRequest.setChannelId(channelId)
                    .setRecordMode(SeminarConstant.RecordMode.manual.getModel())
                    .setEnabled(SeminarConstant.Flag.YES.getFlag());
            seminarSetRecordSettingResponse = new SeminarChannelServiceImpl().setRecordSetting(
                    seminarSetRecordSettingRequest);
            Assert.assertTrue(seminarSetRecordSettingResponse);
            if (seminarSetRecordSettingResponse) {
                //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 Testing Instructions

  1. If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. The error message can be found via PloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. The server encountered an exception and threw a PloyvSdkException. For error details, see PloyvSdkException.getMessage(), e.g., [ Polyv request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Name Required Type Description
channelId true String Channel ID
enabled true String Recording switch: Y for enable, N for disable
recordMode true String Recording mode: auto for automatic, manual for manual

Return Object Description

Modify the return entity for the webinar channel recording settings.




5. Retrieve Attendee Statistics for Seminar Live Room

Description

获取研讨会直播间参会者统计数据
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/seminar/statistics/listViewLogs

Call Constraints

  1. The API call is subject to rate limits. For details, please refer to [/seminar/java/limit.md]. For common call exceptions, please refer to [/seminar/java/exceptionDoc].

Unit Testing

    @Test
    public void testGetViewLog() throws IOException, NoSuchAlgorithmException {
        SeminarGetViewLogRequest seminarGetViewLogRequest = new SeminarGetViewLogRequest();
        SeminarGetViewLogResponse seminarGetViewLogResponse;
        try {
            String channelId = super.getChannelId();
            seminarGetViewLogRequest.setChannelId(channelId)
                    .setStartTime(super.getDate(System.currentTimeMillis() - 20 * 86400000))
                    .setEndTime(super.getDate(System.currentTimeMillis()))
                    .setPageSize(20)
                    .setCurrentPage(1);
            seminarGetViewLogResponse = new SeminarChannelServiceImpl().getViewLog(seminarGetViewLogRequest);
            Assert.assertNotNull(seminarGetViewLogResponse);
            if (seminarGetViewLogResponse != null) {
                //to do something ......
                log.debug("测试获取研讨会直播间参会者统计数据成功 {}", JSON.toJSONString(seminarGetViewLogResponse));
            }
        } 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 Testing Description

  1. If the request is correct, a SeminarGetViewLogResponse object is returned, and the B-side processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. The error message can be found via PloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. The server encountered an exception and threw a PloyvSdkException. For error details, refer to PloyvSdkException.getMessage(), e.g., [ Polyv request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID
startTime true Date Start time
endTime true Date End time (can only query data within 60 days)
currentPage false Integer Page number, defaults to 1 [corresponds to the pageNumber field in the API documentation]
pageSize false Integer Number of data items displayed per page, defaults to 20 items per page

Return Object Description

Parameter Name Type Description
contents Array Participant statistics data [See ViewLog Parameter Description for details]
pageSize Integer Number of data items displayed per page, default is 20 items per page
currentPage Integer Current page [Corresponds to the pageNumber field in the API documentation]
totalItems Integer Total number of records
totalPage Integer Total number of pages [Corresponds to the totalPages field in the API documentation]
ViewLog Parameter Description
Parameter Name Type Description
viewerId String UID
nickName String Nickname
country String Country
province String Region
city String City
ipAddress String Participant IP
startTime Date Entry time
endTime Date Exit time
stayDuration Integer Duration of stay (in seconds)
micCount Integer Number of times connected to mic
micDuration Integer Duration of mic connection (in seconds)
showCount Integer Number of presentations
showDuration Integer Duration of presentation (in seconds)
isMobile String Whether mobile device; values: Y for mobile, N for PC






6. Retrieve Live Room Audience Statistics

Description

获取直播间观众统计数据
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/statistics/listViewLogs

Call Constraints

  1. The API call is subject to rate limits. For details, please refer to [/seminar/java/limit.md]. For common call exceptions, please refer to [/seminar/java/exceptionDoc].

Unit Testing

    @Test
    public void testGetCdnViewLog() throws IOException, NoSuchAlgorithmException {
        SeminarGetCdnViewLogRequest seminarGetCdnViewLogRequest = new SeminarGetCdnViewLogRequest();
        SeminarGetCdnViewLogResponse seminarGetCdnViewLogResponse;
        try {
            String channelId = super.getChannelId();
            seminarGetCdnViewLogRequest.setChannelId(channelId)
                    .setStartTime(super.getDate(System.currentTimeMillis() + 600 * 1000))
                    .setEndTime(super.getDate(System.currentTimeMillis() + 600 * 1000));
            seminarGetCdnViewLogResponse = new SeminarChannelServiceImpl().getCdnViewLog(seminarGetCdnViewLogRequest);
            Assert.assertNotNull(seminarGetCdnViewLogResponse);
            if (seminarGetCdnViewLogResponse != null) {
                //to do something ......
                log.debug("测试获取直播间观众统计数据成功 {}", JSON.toJSONString(seminarGetCdnViewLogResponse));
            }
        } 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 Testing Instructions

  1. If the request is correct, return a SeminarGetCdnViewLogResponse object, and the B-side processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. The error message can be found via PloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]

  3. The server encountered an exception and threw a PloyvSdkException. For error details, refer to PloyvSdkException.getMessage(), e.g., [ Polyv request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID
startTime true Date Start time
endTime true Date End time (only data within the same month as the start time can be queried; for cross-month queries, please make separate requests)
currentPage false Integer Page number, defaults to 1 [corresponds to the pageNumber field in the API documentation]
pageSize false Integer Number of data entries displayed per page, defaults to 20 entries per page

Return Object Description

Parameter Name Type Description
contents Array Audience statistics data [See ViewLog parameter description for details]
pageSize Integer Number of data items displayed per page, default is 20 items per page
currentPage Integer Current page [Corresponds to the pageNumber field in the API documentation]
totalItems Integer Total number of records
totalPage Integer Total number of pages [Corresponds to the totalPages field in the API documentation]
ViewLog Parameter Description
Parameter Name Type Description
viewerId String User ID [corresponds to the param1 field in the API documentation]
viewerName String User nickname [corresponds to the param2 field in the API documentation]
logType String Viewing type: vod for replay; live for live streaming [corresponds to the param3 field in the API documentation]
province String Region
city String City
ipAddress String Viewer IP
createdTime Date Entry time
endTime Date Exit time
playDuration Integer Viewing duration (in seconds)
browser String Viewing device
sessionId String Session






7. Delete a Single Channel

Description

删除单个直播频道
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channels/%s/delete

Call Constraints

  1. The API call has a frequency limit. For details, please refer to [/seminar/java/limit.md]. For common call exceptions, please refer to [/seminar/java/exceptionDoc].

Unit Testing

    @Test
    public void testDeleteChannel() throws IOException, NoSuchAlgorithmException {
        SeminarDeleteChannelRequest seminarDeleteChannelRequest = new SeminarDeleteChannelRequest();
        Boolean seminarDeleteChannelResponse;
        try {
            seminarDeleteChannelRequest.setChannelId("2801915");
            seminarDeleteChannelResponse = new SeminarChannelServiceImpl().deleteChannel(seminarDeleteChannelRequest);
            Assert.assertTrue(seminarDeleteChannelResponse);
            if (seminarDeleteChannelResponse) {
                //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 Testing Instructions

  1. If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. See PloyvSdkException.getMessage() for error details, e.g., [ Validation failed for input parameter [xxx.chat.LivexxxRequest] object, failed field [pic cannot be empty / msg cannot be empty] ]

  3. The server encountered an exception and threw a PloyvSdkException. For error details, see PloyvSdkException.getMessage(), e.g., [ Polyv request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
userId true String POLYV user ID, consistent with the one on the Polyv official website. Retrieval path: Official website -> Login -> Live Streaming (Developer Settings)
channelId true String Channel ID

Return Object Description

Delete Single Channel Return Entity




8. Batch Delete Channels

Description

批量删除直播频道,如果响应失败,则表示全部频道都失败,不会有部份成功、部份失败的结果
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/basic/batch-delete

Call Constraints

  1. The API call has a frequency limit. Click here for details. For common call exceptions, click here for details.

Unit Testing

    @Test
    public void testBatchDeleteChannel() throws IOException, NoSuchAlgorithmException {
        SeminarBatchDeleteChannelRequest seminarBatchDeleteChannelRequest = new SeminarBatchDeleteChannelRequest();
        Boolean seminarBatchDeleteChannelResponse;
        try {
            seminarBatchDeleteChannelRequest.setChannelIds(Arrays.asList("2802164", "2798162"));
            seminarBatchDeleteChannelResponse = new SeminarChannelServiceImpl().batchDeleteChannel(
                    seminarBatchDeleteChannelRequest);
            Assert.assertTrue(seminarBatchDeleteChannelResponse);
            if (seminarBatchDeleteChannelResponse) {
                //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 Testing Instructions

  1. If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. See PloyvSdkException.getMessage() for error details, e.g., [ Validation failed for input parameter [xxx.chat.LivexxxRequest] object, failed field [pic cannot be empty / msg cannot be empty] ]

  3. The server encountered an exception and threw a PloyvSdkException. For error details, refer to PloyvSdkException.getMessage(), e.g., [ Polyv request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelIds true Array Request body parameter, list of channel IDs. Up to 100 channels can be deleted at a time, must be placed in the request body

Return Object Description

Batch Delete Channel Return Entity




9. Query Seminar Meeting Type

Description

查询研讨会会议类型
接口地址(仅做说明使用):https://api.polyv.net/meet/v1/channel/live-type/get

Call Constraints

  1. The API call has a frequency limit. For details, please refer to [/seminar/java/limit.md]. For common call exceptions, please refer to [/seminar/java/exceptionDoc].

Unit Testing

    @Test
    public void testGetLiveType() throws IOException, NoSuchAlgorithmException {
        SeminarGetLiveTypeRequest seminarGetLiveTypeRequest = new SeminarGetLiveTypeRequest();
        SeminarGetLiveTypeResponse seminarGetLiveTypeResponse;
        try {
            String channelId = super.getChannelId();
            seminarGetLiveTypeRequest.setChannelId(channelId);
            seminarGetLiveTypeResponse = new SeminarChannelServiceImpl().getLiveType(seminarGetLiveTypeRequest);
            Assert.assertNotNull(seminarGetLiveTypeResponse);
            if (seminarGetLiveTypeResponse != null) {
                //to do something ......
                log.debug("测试查询研讨会会议类型成功 {}", JSON.toJSONString(seminarGetLiveTypeResponse));
            }
        } 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 Testing Instructions

  1. If the request is correct, return a SeminarGetLiveTypeResponse object, based on which the B-side processes the business logic.

  2. If request parameter validation fails, a PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]

  3. The server encountered an exception and threw a PloyvSdkException. For error details, refer to PloyvSdkException.getMessage(), e.g., [ Polyv request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID

Return Object Description

Parameter Name Type Description
seminarLiveType String Meeting type: private for internal seminars (default), public for external live streaming






10. Modify Seminar Meeting Type

Description

修改研讨会会议类型
接口地址(仅做说明使用):https://api.polyv.net/meet/v1/channel/live-type/update

Call Constraints

  1. The API call is subject to frequency limits. For details, please refer to [/seminar/java/limit.md]. For common call exceptions, please refer to [/seminar/java/exceptionDoc].

Unit Testing

    @Test
    public void testUpdateLiveType() throws IOException, NoSuchAlgorithmException {
        SeminarUpdateLiveTypeRequest seminarUpdateLiveTypeRequest = new SeminarUpdateLiveTypeRequest();
        Boolean seminarUpdateLiveTypeResponse;
        try {
            String channelId = super.getChannelId();
            seminarUpdateLiveTypeRequest.setChannelId(channelId);
            seminarUpdateLiveTypeRequest.setSeminarLiveType("private");
            seminarUpdateLiveTypeResponse = new SeminarChannelServiceImpl().updateLiveType(
                    seminarUpdateLiveTypeRequest);
            Assert.assertNotNull(seminarUpdateLiveTypeResponse);
            if (seminarUpdateLiveTypeResponse != null) {
                //to do something ......
                log.debug("测试修改研讨会会议类型成功 {}", JSON.toJSONString(seminarUpdateLiveTypeResponse));
            }
        } 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 Testing Instructions

  1. If the request is correct, a Boolean object is returned. The B-side processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. The error message can be found via PloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. The server encountered an exception and threw a PloyvSdkException. For error details, see PloyvSdkException.getMessage(), e.g., [ Polyv request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Name Required Type Description
channelId true String Channel ID
seminarLiveType true String Meeting type: private for internal seminars, public for external live streaming

Return Object Description

Modify the return entity for the seminar meeting type

联系客服,在线咨询