account
1. Create a Live Streaming Category Under Your Account
Description
创建账号下直播分类
接口地址(仅做说明使用):https://api.polyv.net/live/v3/user/category/create
Call Constraints
- The API call is subject to rate limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testCreateCategory() throws Exception {
LiveCreateCategoryRequest liveCreateCategoryRequest = new LiveCreateCategoryRequest();
LiveCreateCategoryResponse liveCreateCategoryResponse;
try {
liveCreateCategoryRequest.setCategoryName("分类1");
liveCreateCategoryResponse = new LiveAccountServiceImpl().createCategory(liveCreateCategoryRequest);
Assert.assertNotNull(liveCreateCategoryResponse);
log.debug("测试创建账号下直播分类成功,{}", JSON.toJSONString(liveCreateCategoryResponse));
} 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
If the request is correct, a
LiveCreateCategoryResponseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| categoryName | true | String | Channel category name |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the POLYV official website. Path: Official website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the POLYV official website. Path: Official website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| categoryId | Integer | Category ID |
| categoryName | String | Category name |
| userId | String | POLYV user ID, consistent with the one on the Polyv official website. To obtain it: Official website -> Login -> Live Streaming (Development Settings) |
| rank | Integer | Category sorting (sorted from smallest to largest) |
2. Query Live Categories Under Account
Description
查询账号下直播分类
接口地址(仅做说明使用):https://api.polyv.net/live/v3/user/category/list
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testListCategory() throws Exception {
LiveListCategoryRequest liveListCategoryRequest = new LiveListCategoryRequest();
LiveListCategoryResponse liveListCategoryResponse;
try {
liveListCategoryResponse = new LiveAccountServiceImpl().listCategory(liveListCategoryRequest);
Assert.assertNotNull(liveListCategoryResponse);
log.debug("测试查询账号下直播分类成功,{}", JSON.toJSONString(liveListCategoryResponse));
} 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
If the request is correct, a
LiveListCategoryResponseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. SeePloyvSdkException.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] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| liveCategories | Array | Channel category list [See LiveCategory Parameter Description for details] |
LiveCategory Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| categoryId | Integer | Category ID |
| categoryName | String | Category name |
| userId | String | POLYV user ID, consistent with the one on the Polyv official website. Retrieval path: Official website -> Login -> Live Streaming (Developer Settings) |
| rank | Integer | Category sort number; rank=0 indicates default sorting |
3. Modify Live Channel Category Name
Description
修改直播频道分类名称
接口地址(仅做说明使用):https://api.polyv.net/live/v3/user/category/update-name
Call Constraints
Unit Testing
@Test
public void testUpdateCategory() throws Exception {
LiveUpdateCategoryRequest liveUpdateCategoryRequest = new LiveUpdateCategoryRequest();
Boolean liveUpdateCategoryResponse;
try {
liveUpdateCategoryRequest.setCategoryId(391976).setCategoryName("勿删分类-" + super.getRandomString(4));
liveUpdateCategoryResponse = new LiveAccountServiceImpl().updateCategory(liveUpdateCategoryRequest);
Assert.assertTrue(liveUpdateCategoryResponse);
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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found inPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| categoryId | true | Integer | Category ID |
| categoryName | true | String | Category Name |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
true indicates modification succeeded, false indicates modification failed
4. Modify Live Channel Category Order
Description
修改直播频道分类顺序
接口地址(仅做说明使用):https://api.polyv.net/live/v3/user/category/update-rank
Call Constraints
- API calls are subject to frequency limits. See details. For common call exceptions, see details.
Unit Testing
@Test
public void testUpdateCategorySort() throws Exception {
LiveUpdateCategorySortRequest liveUpdateCategorySortRequest = new LiveUpdateCategorySortRequest();
Boolean liveUpdateCategorySortResponse;
try {
liveUpdateCategorySortRequest.setCategoryId(388964).setAfterCategoryId(340019);
liveUpdateCategorySortResponse = new LiveAccountServiceImpl().updateCategorySort(
liveUpdateCategorySortRequest);
Assert.assertTrue(liveUpdateCategorySortResponse);
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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| categoryId | true | Integer | Category ID |
| afterCategoryId | true | Integer | Move to after the category corresponding to this ID |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtained by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtained by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
true indicates the sorting modification was successful, false indicates the sorting modification failed.
5. Delete Live Channel Category
Description
删除直播频道分类
接口地址(仅做说明使用):https://api.polyv.net/live/v3/user/category/delete
Call Constraints
- The API call is subject to rate limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testDeleteCategory() throws Exception {
LiveDeleteCategoryRequest liveDeleteCategoryRequest = new LiveDeleteCategoryRequest();
Boolean liveDeleteCategoryResponse;
try {
liveDeleteCategoryRequest.setCategoryId(345128);
liveDeleteCategoryResponse = new LiveAccountServiceImpl().deleteCategory(liveDeleteCategoryRequest);
Assert.assertTrue(liveDeleteCategoryResponse);
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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 Name | Required | Type | Description |
|---|---|---|---|
| categoryId | true | Integer | Category ID |
| appId | false | String | POLYV user APP_ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). It can be obtained by registering on the POLYV official website. Path: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). It can be obtained by registering on the POLYV official website. Path: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
true indicates successful deletion, false indicates deletion failed.
6. Get Live User Account Information API
Description
获取直播用户账号信息接口
接口地址(仅做说明使用):https://api.polyv.net/live/v3/user/get-info
Call Constraints
- The API call is subject to rate limits. Click here for details. For common call exceptions, click here for details.
Unit Testing
@Test
public void testGetAccountInfo() throws Exception {
LiveAccountInfoRequest liveAccountInfoRequest = new LiveAccountInfoRequest();
LiveAccountInfoResponse liveAccountInfoResponse;
try {
liveAccountInfoResponse = new LiveAccountServiceImpl().getAccountInfo(liveAccountInfoRequest);
Assert.assertNotNull(liveAccountInfoResponse);
log.debug("测试获取直播用户账号信息接口成功,{}", JSON.toJSONString(liveAccountInfoResponse));
} 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
If the request is correct, a
LiveAccountInfoResponseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| userId | String | POLYV user ID, consistent with the one on the Polyv official website. Retrieval path: Official website -> Login -> Live Streaming (Developer Settings) |
| String | Email account | |
| maxChannels | Integer | Maximum number of channels that can be created |
| totalChannels | Integer | Total number of channels currently created |
| availableChannels | Integer | Number of channels currently available for creation |
| linkMicLimit | Integer | Maximum number of participants allowed for co-streaming on the account |
7. Query Detailed Information of All Channels Under an Account
Description
查询账号下所有频道详细信息
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/management/list-detail
Call Constraints
- The API call is subject to rate limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testListAccountDetail() throws Exception, NoSuchAlgorithmException {
LiveListAccountDetailRequest liveListAccountDetailRequest = new LiveListAccountDetailRequest();
LiveListAccountDetailResponse liveListAccountDetailResponse;
try {
liveListAccountDetailRequest.setCurrentPage(1);
liveListAccountDetailResponse = new LiveAccountServiceImpl().listAccountDetail(
liveListAccountDetailRequest);
Assert.assertNotNull(liveListAccountDetailResponse);
if (liveListAccountDetailResponse != null) {
//to do something ......
log.debug("分页查询账号下所有频道详细信息成功,{}", JSON.toJSONString(liveListAccountDetailResponse));
}
} 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
If the request is correct, a
LiveListAccountDetailResponseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 Name | Required | Type | Description |
|---|---|---|---|
| categoryId | false | Integer | Category ID |
| watchStatus | false | String | Watch page status filter: live (live streaming), playback (replay), end (ended), waiting (not started) |
| keyword | false | String | Channel name, fuzzy search |
| currentPage | false | Integer | Page number, default is 1 (corresponds to the page field in the API documentation) |
| pageSize | false | Integer | Number of data items per page, default is 20 |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter | Type | Description |
|---|---|---|
| contents | Array | List of channel details [See LiveChannelDetail Parameter Description] |
| 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] |
LiveChannelDetail Parameter Description
| Parameter | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| name | String | Channel name |
| channelPasswd | String | Channel password |
| categoryId | String | Channel category ID |
| scene | String | Scene: alone - event live, ppt - three-screen, topclass - large class, seminar - seminar |
| sceneText | String | Scene description, e.g., Large Class |
| watchStatus | String | Watch page status: live - streaming, playback - replaying, end - ended, waiting - not started |
| watchStatusText | String | Watch page status description: Streaming, Replaying, Ended, Not Started |
| watchUrl | String | Watch page URL |
| content | String | Live stream introduction |
| startTime | Date | Live stream start time |
| authSetting | Array | Live stream permission settings data transfer object [See LiveAuthSetting parameter description] |
LiveAuthSetting Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| rank | Integer | Used to set two viewing conditions for one channel, value is 1 or 2 (1 for primary condition, 2 for secondary condition) |
| userId | String | POLYV user ID, consistent with the official POLYV website. Retrieval path: Official website -> Login -> Live Streaming (Development Settings) |
| globalSettingEnabled | String | Whether to enable global settings (Y/N) |
| enabled | String | Whether to enable viewing conditions (Y/N) |
| authType | String | Viewing condition type (1. No restriction none 2. Verification code viewing code 3. Paid viewing pay 4. Whitelist viewing phone 5. Registration viewing info 6. Share viewing wxshare 7. Custom authorization viewing custom 8. External authorization viewing external) |
| codeAuthTips | String | Prompt message for verification code viewing |
| authCode | String | Verification code for the verification code viewing method |
| qcodeTips | String | QR code prompt for the verification code viewing method |
| qcodeImg | String | QR code image for the verification code viewing method |
| payAuthTips | String | Prompt message for paid viewing |
| price | Float | Price for paid viewing |
| validTimePeriod | String | Duration limit for paid viewing (days) |
| watchEndTime | Date | End time for paid viewing; null indicates: one-time payment, permanently valid |
| authTips | String | Prompt message for whitelist viewing |
| infoAuthTips | String | Prompt message for registration viewing |
| customKey | String | Key for custom authorization viewing |
| customUri | String | Interface address for custom authorization viewing |
| externalKey | String | Key for external authorization viewing |
| externalUri | String | Interface address for external authorization viewing |
| externalRedirectUri | String | Redirect address for users directly accessing the viewing page under external authorization |
| directKey | String | Independent authorization key |
| trialWatchEnabled | String | Trial watch toggle, Y: enable trial watch, N: disable trial watch |
| trialWatchTime | Integer | Trial watch time, in minutes |
| trialWatchEndTime | Date | Trial watch end date; null indicates permanently valid for that channel |
8. Query the Channel List Under an Account
Description
查询账号下的频道列表
接口地址(仅做说明使用):https://api.polyv.net/live/v3/user/channels
Call Constraints
- The API call is subject to rate limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testListAccount() throws Exception, NoSuchAlgorithmException {
LiveListAccountRequest liveListAccountRequest = new LiveListAccountRequest();
LiveListAccountResponse liveListAccountResponse;
try {
liveListAccountRequest.setCategoryId(null).setKeyword(null);
liveListAccountResponse = new LiveAccountServiceImpl().listAccount(liveListAccountRequest);
Assert.assertNotNull(liveListAccountResponse);
if (liveListAccountResponse != null) {
//to do something ......
log.debug("测试查询账号下的频道列表成功,{}", JSON.toJSONString(liveListAccountResponse));
}
} 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
If the request is correct, a
LiveListAccountResponseobject is returned. The B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| categoryId | false | Integer | The category ID to which it belongs. If not provided, channel numbers under all categories will be queried. |
| keyword | false | String | Channel name, fuzzy search. |
| appId | false | String | POLYV user APP_ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET. This parameter is required for multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| channels | Array | List of channel numbers |
9. Get Account Co-hosting Minutes Usage and Remaining Amount
Description
获取账号连麦分钟数使用量与剩余量
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/statistics/mic/get-duration
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testGetMicDuration() throws Exception, NoSuchAlgorithmException {
LiveAccountMicDurationRequest liveAccountMicDurationRequest = new LiveAccountMicDurationRequest();
LiveAccountMicDurationResponse liveAccountMicDurationResponse;
try {
liveAccountMicDurationResponse = new LiveAccountServiceImpl().getMicDuration(liveAccountMicDurationRequest);
Assert.assertNotNull(liveAccountMicDurationResponse);
if (liveAccountMicDurationResponse != null) {
//to do something ......
log.debug("测试获取账号连麦分钟数使用量与剩余量成功,{}", JSON.toJSONString(liveAccountMicDurationResponse));
}
} 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
If the request is correct, return a
LiveAccountMicDurationResponseobject, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| available | Integer | Available co-hosting minutes, in minutes |
| history | Integer | Historical co-hosting minutes used, in minutes |
10. Setting the Token for Single Sign-On (SSO) Account
Description
设置账号单点登录的token
接口地址(仅做说明使用):https://api.polyv.net/live/v3/user/set-sso-token
Call Constraints
The API call is subject to rate limits. Click here for details. For common call exceptions, click here for details.
The token parameter should not be too simple; it is recommended to use a 16-character random string.
Unit Test
@Test
public void testCreateAccountToken() throws Exception, NoSuchAlgorithmException {
LiveCreateAccountTokenRequest liveCreateAccountTokenRequest = new LiveCreateAccountTokenRequest();
Boolean liveCreateAccountTokenResponse;
try {
liveCreateAccountTokenRequest.setToken(LiveSignUtil.generateUUID());
liveCreateAccountTokenResponse = new LiveAccountServiceImpl().createAccountToken(
liveCreateAccountTokenRequest);
Assert.assertNotNull(liveCreateAccountTokenResponse);
if (liveCreateAccountTokenResponse) {
//to do something ......
log.debug("测试设置账号单点登录的token成功");
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found inPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| token | true | String | A unique string. It should not be too simple; it is recommended to use a 16-character random string. |
| appId | false | String | POLYV user APP_ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
true indicates success, false indicates failure
11. Set Live Status Callback Notification URL
Description
设置直播状态回调通知url
接口地址(仅做说明使用):https://api.polyv.net/live/v2/user/%s/set-stream-callback
Call Constraints
The API call is subject to rate limits. Click here for details. For common call exceptions, click here for details.
If the address parameter
urlis not submitted, the callback address will be empty, indicating that the callback function is disabled. If the address parameterurlis to be submitted, it must start withhttp://orhttps://.
Unit Test
@Test
public void testUpdateStreamCallbackUrl() throws Exception, NoSuchAlgorithmException {
LiveAccountStreamCallbackRequest liveAccountStreamCallbackRequest = new LiveAccountStreamCallbackRequest();
Boolean liveAccountStreamCallbackResponse;
try {
liveAccountStreamCallbackRequest.setUrl("http://www.abc.com/callback");
liveAccountStreamCallbackResponse = new LiveAccountServiceImpl().updateStreamCallbackUrl(
liveAccountStreamCallbackRequest);
Assert.assertNotNull(liveAccountStreamCallbackResponse);
if (liveAccountStreamCallbackResponse) {
//to do something ......
log.debug("测试设置直播状态回调通知url成功");
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes the business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 | false | String | POLYV user ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website. Path: Official website -> Login -> Live Streaming (Development Settings) |
| url | false | String | Callback URL. Leave blank to disable the callback function. If submitted, it must start with http://或者https://开头 |
| appId | false | String | POLYV user APP_ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website. Path: Official website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website. Path: Official website -> Login -> Live Streaming (Development Settings) |
Return Object Description
true indicates the callback was set successfully, false indicates the callback failed.
Callback Description
After setting the callback URL, if there are push or stop operations on channels under the account that cause the channel's live streaming status to change, the live streaming system will submit the following parameters channelId (channel ID) and status (live streaming status: live indicates the stream has started, end indicates the stream has ended) to the user-defined callback URL via GET method for notification. For example: http://abc.com/test.do?channelId=123456&status=live×tamp=1557976774000&sign=xxdxxxxx&sessionId=xxxxxddd&startTime=1557976777111&endTime=1557976777111
| Parameter Name | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| status | String | Live channel status: live indicates the stream is ongoing, end indicates the stream has ended |
| timestamp | Long | 13-digit timestamp |
| sign | String | Encrypted string for verification, generated using the rule md5(AppSecret+timestamp), where AppSecret is the secret key of the live streaming system |
| sessionId | String | Session ID of the live stream |
| startTime | Date | Start time of the live stream |
| endTime | Date | End time of the live stream (present when status=end, null when status=live) |
12. Set the Callback URL for Successful Transfer Notification
Description
设置转存成功回调通知url
接口地址(仅做说明使用):https://api.polyv.net/live/v2/user/%s/set-playback-callback
Call Constraints
The API call has a frequency limit. See details. For common call exceptions, see details.
If the address parameter
urlis not submitted, the callback address will be empty, indicating that the callback function is disabled. If the address parameterurlis to be submitted, it must start withhttp://orhttps://.
Unit Test
@Test
public void testUpdatePlaybackCallbackUrl() throws Exception, NoSuchAlgorithmException {
LiveAccountPlaybackCallbackRequest liveAccountPlaybackCallbackRequest =
new LiveAccountPlaybackCallbackRequest();
Boolean liveAccountPlaybackCallbackResponse;
try {
liveAccountPlaybackCallbackRequest.setUrl("http://www.abc.com/callback");
liveAccountPlaybackCallbackResponse = new LiveAccountServiceImpl().updatePlaybackCallbackUrl(
liveAccountPlaybackCallbackRequest);
Assert.assertTrue(liveAccountPlaybackCallbackResponse);
if (liveAccountPlaybackCallbackResponse != null) {
//to do something ......
log.debug("测试设置转存成功回调通知url成功,{}", liveAccountPlaybackCallbackResponse);
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes the business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found inPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 | false | String | POLYV user ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website. Path: Official website -> Login -> Live Streaming (Development Settings) |
| url | false | String | Callback URL. Leave it empty to disable the callback function. If provided, it must start with http://或者https://开头 |
| appId | false | String | POLYV user APP_ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website. Path: Official website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website. Path: Official website -> Login -> Live Streaming (Development Settings) |
Return Object Description
true indicates the callback was set successfully, false indicates the callback failed.
Callback Description
After setting the interface address, if the account performs temporary video transfer (i.e., transferring the recorded file generated during live streaming to on-demand storage), and the transferred video processing is completed, the live streaming system will submit the following parameters: channelId (channel ID), vid (successfully transferred video ID), title (video title), duration (video duration), and fileSize (video file size) via GET method to the user-defined callback interface for notification. For example: http://abc.com/test.do?channelId=123456&vid=e6b23c6f5134943a015bc117e2854eae_e&title=视频标题&duration=01:23:45&fileSize=123400×tamp=1557976774000&sign=xxxxxxxxxx&fileId=359a81ed8fd8cb83d88ddcd97d9e8a2b&videoId=b1c6f3ad2c&origin=auto&sessionIds=["20190703145126,4,fdqbopvtnv","20190703145126,8,fdqbopvtnv"].
| Parameter Name | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| vid | String | Video ID after successful transfer |
| title | String | Video title |
| duration | String | Video duration in hh:mm:ss format |
| fileSize | Long | Video file size in bytes |
| timestamp | Long | 13-digit timestamp (used for signing) |
| sign | String | Encrypted string for verification, generated using the rule md5(AppSecret+timestamp), where AppSecret is the secret key of the live streaming system |
| sessionIds | String | Array string of recorded sessions and their corresponding times, format: ["20190703145126,4,fdqbopvtnv","20190703145126,8,fdqbopvtnv"], where: "20190703145126,4,fdqbopvtnv" - the first field is the start time, the second field is the live duration, and the third is the corresponding sessionId. |
| fileId | String | File ID of the transferred recording |
| videoId | String | Unique ID of the transferred playback |
| origin | String | Source of the transferred recording. manual - cloud recording, auto - automatic recording, merge - merged, clip - clipped |
| sessionId | String | Single session ID corresponding to the playback |
| userId | String | POLYV user ID, consistent with the one on the Polyv official website. Retrieval path: Official website -> Login -> Live Streaming (Development Settings) |
| status | String | Returns success upon successful transfer |
13. Set Recording Callback Notification URL
Description
设置录制回调通知url
接口地址(仅做说明使用):https://api.polyv.net/live/v2/user/%s/set-record-callback
Call Constraints
The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
If the address parameter
urlis not submitted, the callback address will be empty, indicating that the callback function is disabled. If the address parameterurlis to be submitted, it must start withhttp://orhttps://.
Unit Test
@Test
public void testUpdateRecordCallbackUrl() throws Exception, NoSuchAlgorithmException {
LiveAccountRecordCallbackRequest liveAccountRecordCallbackRequest = new LiveAccountRecordCallbackRequest();
Boolean liveAccountRecordCallbackResponse;
try {
liveAccountRecordCallbackRequest.setUrl("http://www.abc.com/callback");
liveAccountRecordCallbackResponse = new LiveAccountServiceImpl().updateRecordCallbackUrl(
liveAccountRecordCallbackRequest);
Assert.assertTrue(liveAccountRecordCallbackResponse);
if (liveAccountRecordCallbackResponse) {
//to do something ......
log.debug("测试设置录制回调通知url成功");
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes the business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| userId | false | String | POLYV user ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
| url | false | String | Callback URL. If not submitted, the callback function is disabled. If submitted, it must start with http://或者https://开头. |
| appId | false | String | POLYV user APP_ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET. This parameter is required for multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
true indicates the callback was set successfully, false indicates the callback failed.
Callback Description
After setting the callback URL, if the account has the recording feature enabled, when a channel under the account finishes streaming and generates an m3u8 recording video, the live streaming system will submit the parameters channelId (channel ID) and fileUrl (recording file URL) to the user-defined callback URL via a GET request for notification. For example: http://abc.com/test.do?channelId=104400&fileUrl=http://rflive.videocc.net/i6ro0hxj0020150529112242035/recordf.i6ro0hxj0020150529112242035_20170120184803.m3u8&origin=auto&fileId=072c36138cfbd3e546cda227dc273951×tamp=1557976774000&sign=xxxxxxxxxx
| Parameter | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| fileUrl | String | Recording file URL |
| format | String | File type, m3u8 or mp4 |
| timestamp | Long | 13-digit timestamp (used for signing) |
| sign | String | Encrypted string for verification, generated using the rule md5(AppSecret+timestamp), where AppSecret is the live streaming system key |
| fileId | String | Unique recording ID |
| origin | String | Recording source. manual - cloud recording, auto - automatic recording, merge - merged, clip - clipped |
| hasRtcRecord | String | (This field is only useful when cloud recording is enabled). Value 'Y' indicates that both cloud recording and automatic recording exist for this live stream; value 'N' indicates that only automatic recording exists for this live stream |
14. Set Feature Switch Status
Description
设置功能开关状态
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/switch/update
Call Constraints
The API call has a frequency limit. For details, see here. For common call exceptions, see here.
isClosePreview: WhenenabledisY, it indicates closing the system preview page.closeDanmu: WhenenabledisY, it indicates closing the danmaku (bullet comments).closeChaterList: WhenenabledisY, it indicates closing the online user list.
Unit Test
@Test
public void testUpdateAccountSwitch() throws Exception, NoSuchAlgorithmException {
LiveUpdateAccountSwitchRequest liveUpdateAccountSwitchRequest = new LiveUpdateAccountSwitchRequest();
Boolean liveUpdateAccountSwitchResponse;
try {
liveUpdateAccountSwitchRequest.setType(LiveConstant.ChannelSwitch.AUTO_PLAY.getDesc()).setEnabled("N");
liveUpdateAccountSwitchResponse = new LiveAccountServiceImpl().updateAccountSwitch(
liveUpdateAccountSwitchRequest);
Assert.assertNotNull(liveUpdateAccountSwitchResponse);
if (liveUpdateAccountSwitchResponse) {
//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
If the request is successful, a Boolean object is returned, and the B-side uses this object to handle business logic.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 Name | Required | Type | Description |
|---|---|---|---|
| channelId | false | String | Channel ID. If not provided, the global settings will be modified. |
| type | true | String | Switch type. If not specified, Y indicates enabled by default. isClosePreview: Whether to close the system viewing page. Y means closed. mobileWatch: Whether to enable the mobile system viewing page. mobileAudio: Whether to enable mobile audio/video switching. autoPlay: Whether to enable the player auto-play feature. booking: Whether to enable the booking feature. redPack: Whether to enable the red packet feature. shareBtnEnabled: Whether to enable the sharing feature. chat: Whether to enable the chat room. closeChaterList: Whether to close the online user list. Y means closed. consultingMenu: Whether to enable the consultation and Q&A feature. closeDanmu: Whether to close the danmaku (bullet comments) feature. Y means closed. praise: Whether to enable the praise phrase feature. welcome: Whether to enable the welcome message feature. viewerSendImgEnabled: Whether to allow viewers to send images. qaMenuEnabled: Whether to enable the Q&A feature. filterManagerMsgEnabled: Filter chat room manager messages switch, i.e., the "host-only" chat mode on the viewing page. showCustomMessageEnabled: Display custom messages switch. chatOnlineNumberEnable: Online user count switch. |
| enabled | true | String | Switch value, Y or N. |
| appId | false | String | POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
true indicates success, false indicates failure
15. Query Feature Switch Status API
Description
接口用于获取开关设置,可获取全局开关设置或频道开关设置
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/switch/get
Call Constraints
API calls are subject to rate limits. Click here for details. For common call exceptions, click here for details.
isClosePreview: When theenabledvalue isY, it indicates closing the system preview page.closeDanmu: When theenabledvalue isY, it indicates closing the danmaku (bullet comments).closeChaterList: When theenabledvalue isY, it indicates closing the online user list.Return only when the channel is not in a three-screen layout: mobileAudio switch, redPack switch, praise phrase switch, chatPlayBack switch
Unit Test
@Test
public void testGetAccountSwitch() throws Exception, NoSuchAlgorithmException {
LiveAccountSwitchRequest liveAccountSwitchRequest = new LiveAccountSwitchRequest();
LiveAccountSwitchResponse liveAccountSwitchResponse;
try {
liveAccountSwitchRequest.setChannelId(null);
liveAccountSwitchResponse = new LiveAccountServiceImpl().getAccountSwitch(liveAccountSwitchRequest);
Assert.assertNotNull(liveAccountSwitchResponse);
if (liveAccountSwitchResponse != null) {
//to do something ......
log.debug("测试查询功能开关状态接口成功,{}", JSON.toJSONString(liveAccountSwitchResponse));
}
} 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
If the request is correct, return a
LiveAccountSwitchResponseobject, based on which the B-side handles business logic.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found inPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 Name | Required | Type | Description |
|---|---|---|---|
| channelId | false | String | Channel ID. If not provided, the global settings will be retrieved. |
| appId | false | String | POLYV user APP_ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET. This parameter is required for multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| channelSwitches | Array | Channel switches [See ChannelSwitch Parameter Description for details] |
ChannelSwitch Parameter Description
| Parameter | Type | Description |
|---|---|---|
| type | String | Switch type isClosePreview: Whether to close the system viewing page, Y means closed mobileWatch: Whether to enable the mobile system viewing page mobileAudio: Whether to enable mobile audio/video switching autoPlay: Whether to enable the player auto-play function booking: Whether to enable the booking function redPack: Whether to enable the red packet function shareBtnEnabled: Whether to enable the sharing function chat: Whether to enable the chat room closeChaterList: Whether to close the online list, Y means closed consultingMenu: Whether to enable consultation and questioning closeDanmu: Whether to close the danmaku function, Y means closed barrageSpeed: Danmaku speed (quickest/quicker/slowest/slower/standard) praise: Whether to enable the praise phrase function welcome: Whether to enable the welcome message function viewerSendImgEnabled: Whether to allow viewers to send images qaMenuEnabled: Whether to enable the Q&A function filterManagerMsgEnabled: Filter chat room admin messages switch (host only) showCustomMessageEnabled: Display custom messages switch chatOnlineNumberEnable: Online user count switch pvShowEnabled: Whether to display visit count, Y-enabled, N-disabled chatPlayBack: Whether to enable chat playback switch pushSharingEnabled: Whether to enable streaming sharing switch sendFlowersEnabled: Whether to enable the flower sending switch |
| enabled | String | Whether the switch is turned on |
16. Query Thumbnail Information of All Channels Under an Account
Description
查询账号下所有频道缩略信息
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/management/list
Call Constraints
- The API call is subject to rate limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testListChannelBasic() throws Exception, NoSuchAlgorithmException {
LiveListAccountChannelBasicRequest liveListAccountChannelBasicRequest =
new LiveListAccountChannelBasicRequest();
LiveListAccountChannelBasicResponse liveListAccountChannelBasicResponse;
try {
liveListAccountChannelBasicRequest.setCategoryId(null)
.setWatchStatus("end")
.setKeyword("勿删")
.setPageSize(null)
.setCurrentPage(1);
liveListAccountChannelBasicResponse = new LiveAccountServiceImpl().listChannelBasic(
liveListAccountChannelBasicRequest);
Assert.assertNotNull(liveListAccountChannelBasicResponse);
if (liveListAccountChannelBasicResponse != null) {
//to do something ......
log.debug("测试查询账号下所有频道缩略信息成功,{}", JSON.toJSONString(liveListAccountChannelBasicResponse));
}
} 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
If the request is correct, return a LiveListAccountChannelBasicResponse object. The B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| categoryId | false | Integer | Category ID |
| watchStatus | false | String | Watch page status filter: live (live streaming), playback (replay), end (ended), waiting (not started) |
| keyword | false | String | Channel name, fuzzy search |
| currentPage | false | Integer | Page number, defaults to 1 (corresponds to the page field in the 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 to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter | Type | Description |
|---|---|---|
| contents | Array | Basic channel information [See ChannelBasicInfo parameter description] |
| 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] |
ChannelBasicInfo Parameter Description
| Parameter | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| name | String | Channel name |
| channelPasswd | String | Channel password |
| scene | String | Scene: alone - live event, ppt - three-screen, topclass - large class, seminar - seminar |
| sceneText | String | Scene description |
| watchStatus | String | Watch page status: live - live streaming, playback - replaying, end - ended, waiting - not started |
| watchStatusText | String | Watch page status description: live streaming, replaying, ended, not started |
| watchUrl | String | Watch page URL |
17. Query Account Minutes
Description
查询账户分钟数
接口地址(仅做说明使用):https://api.polyv.net/live/v2/user/get-user-durations
Call Constraints
- The API call is subject to frequency limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testGetUserDurations() throws Exception, NoSuchAlgorithmException {
LiveAccountUserDurationsRequest liveAccountUserDurationsRequest = new LiveAccountUserDurationsRequest();
LiveAccountUserDurationsResponse liveAccountUserDurationsResponse;
try {
liveAccountUserDurationsResponse = new LiveAccountServiceImpl().getUserDurations(
liveAccountUserDurationsRequest);
Assert.assertNotNull(liveAccountUserDurationsResponse);
if (liveAccountUserDurationsResponse != null) {
//to do something ......
log.debug("测试查询账户分钟数成功,{}", JSON.toJSONString(liveAccountUserDurationsResponse));
}
} 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
If the request is correct, a
LiveAccountUserDurationsResponseobject is returned, and Party B processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. SeePloyvSdkException.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] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID, required when making multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Developer Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required when making multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Developer Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| userId | String | POLYV user ID, consistent with the one on the Polyv official website. How to obtain: Official website -> Login -> Live Streaming (Developer Settings) |
| available | Long | Current available minutes |
| used | Long | Historical minutes already used |
18. Query Revenue Details for All or a Specific Channel Under an Account
Description
查询账号下所有/某个频道号收入详情
接口地址(仅做说明使用):https://api.polyv.net/live/v2/user/%s/get-income-detail
Call Constraints
- API calls are subject to rate limits. For details, see here. For common call exceptions, see here. Retrieve revenue details for all channels or a specific channel based on whether a channelId is provided.
Unit Test
@Test
public void testGetChannelIncomeDetail() throws Exception {
LiveChannelIncomeDetailRequest liveChannelIncomeDetailRequest = new LiveChannelIncomeDetailRequest();
LiveChannelIncomeDetailResponse liveChannelIncomeDetailResponse;
try {
String channelId = super.createChannel();
liveChannelIncomeDetailRequest.setChannelId(channelId)
.setStartDate(getDate(2019, 10, 24))
.setEndDate(getDate(2021, 11, 11));
liveChannelIncomeDetailResponse = new LiveAccountServiceImpl().getChannelIncomeDetail(
liveChannelIncomeDetailRequest);
Assert.assertNotNull(liveChannelIncomeDetailResponse);
if (liveChannelIncomeDetailResponse != null) {
//to do something ......
log.debug("测试查询账号下所有/某个频道号收入详情成功,{}", JSON.toJSONString(liveChannelIncomeDetailResponse));
}
} 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
If the request is correct, a LiveChannelIncomeDetailResponse object is returned, and the B-end processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 | false | String | POLYV user ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
| channelId | false | String | The channel ID to query. If not provided, all channels are queried by default. |
| startDate | true | Date | The start date of the query, in the format yyyy-MM-dd. |
| endDate | true | Date | The end date of the query, in the format yyyy-MM-dd. |
| currentPage | false | Integer | The page number, defaults to 1. Corresponds to the page field in the API documentation. |
| pageSize | false | Integer | The number of data entries displayed per page, defaults to 20 entries per page. |
| appId | false | String | POLYV user APP_ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| contents | Array | Income details [See ChannelIncomeDetail parameter description] |
| 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] |
ChannelIncomeDetail Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| amount | Float | Amount |
| payType | String | Income type: good, cash, pay |
| payTypeName | String | Name of the income type: Prop Tip, Cash Tip, Pay-per-View |
| viewerName | String | Nickname of the paying viewer |
| payTime | Date | Payment time |
| outTradeNo | String | Internal order number of the Polyv system |
19. Paginated Query of Channels That Can Set Up Receiving Rebroadcast Channel List
Description
通过一个(发起转播的)频道分页查询能够被它设置接收转播的频道列表
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/basic/receive/list
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testGetReceiveList() throws IOException, NoSuchAlgorithmException {
LiveChannelReceiveListRequest liveChannelReceiveListRequest = new LiveChannelReceiveListRequest();
LiveChannelReceiveListResponse liveChannelReceiveListResponse;
try {
String channelId = super.createChannel();
liveChannelReceiveListRequest.setChannelId(channelId);
liveChannelReceiveListResponse = new LiveAccountServiceImpl().getReceiveList(liveChannelReceiveListRequest);
Assert.assertNotNull(liveChannelReceiveListResponse);
if (liveChannelReceiveListResponse != null) {
//to do something ......
log.debug("测试分页查询频道可设置接收转播频道列表成功 {}", JSON.toJSONString(liveChannelReceiveListResponse));
}
} 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
If the request is correct, a
LiveChannelReceiveListResponseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields: [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| channelId | true | String | Channel ID (for initiating relay broadcasting) |
| keyword | false | String | Channel name, supports fuzzy search |
| currentPage | false | Integer | Page number, defaults to 1 [Corresponds to the page field in the API documentation] |
| pageSize | false | Integer | Number of data items displayed per page, defaults to 20 |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter | Type | Description |
|---|---|---|
| contents | Array | Query result list See ReceiveList parameter description |
| 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] |
ReceiveList Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| name | String | Channel name |
| channelPasswd | String | Channel password, used in non-seminar scenarios |
| hostPasswd | String | Seminar host password, used in seminar scenarios |
| attendeePasswd | String | Seminar attendee password, used in seminar scenarios |
| categoryName | String | Name of the category the channel belongs to |
| authType | String | Viewing conditions, separated by commas, e.g., none,none. none: No conditions, pay: Paid viewing, code: Verification code viewing, phone: Whitelist viewing, info: Registration viewing, custom: Custom authorization viewing, external: External authorization, direct: Direct authorization |
| recentViewCount | Integer | Number of viewers in the most recent session |
| subChannelAccount | String | First sub-channel ID, or null if there is no sub-channel |
| subChannelPasswd | String | First sub-channel password, or null if there is no sub-channel |
| transmitChannelId | String | Associated rebroadcast channel ID, or null if not associated |
| scene | String | Scene: alone: Live streaming, ppt: Three-screen, topclass: Large class |
20. Query Thumbnail Information for All Channels
Description
查询账号下所有的频道缩略信息列表,观看页状态与新版后台一致
接口地址(仅做说明使用):https://api.polyv.net/live/v4/channel/simple/list
Call Constraints
- The API call is subject to rate limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testListChannelSimpleV2() throws Exception, NoSuchAlgorithmException {
LiveListAccountChannelSimpleV2Request liveListAccountChannelSimpleV2Request =
new LiveListAccountChannelSimpleV2Request();
LiveListAccountChannelSimpleV2Response liveListAccountChannelSimpleV2Response;
try {
liveListAccountChannelSimpleV2Request.setCategoryId(null)
.setOrderBy(LiveConstant.OrderBy.CHANNEL_CREATED_TIME_DESC.getType());
liveListAccountChannelSimpleV2Response = new LiveAccountServiceImpl().listChannelSimpleV2(
liveListAccountChannelSimpleV2Request);
Assert.assertNotNull(liveListAccountChannelSimpleV2Request);
if (liveListAccountChannelSimpleV2Response != null) {
//to do something ......
log.debug("测试查询所有频道的缩略信息成功,{}", JSON.toJSONString(liveListAccountChannelSimpleV2Response));
}
} 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
If the request is correct, return a
LiveListAccountChannelSimpleV2Responseobject. The B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]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 Name | Required | Type | Description |
|---|---|---|---|
| categoryId | false | Integer | Category ID |
| watchStatus | false | String | Watch page status filter: live (live streaming), playback (replay), end (ended), waiting (waiting), unStart (not started) |
| keyword | false | String | Channel name, fuzzy search |
| orderBy | false | String | Sort field, default ascending by channel creation time. Options: startTimeDesc (descending by start time), startTimeAsc (ascending by start time), channelCreatedTimeDesc (descending by channel creation time) |
| currentPage | false | Integer | Page number, default is 1 (corresponds to the pageNumber field in the API documentation) |
| pageSize | false | Integer | Number of data items displayed per page, default is 20 items per page |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| contents | Array | Basic channel information [See ChannelBasicInfo parameter description] |
| 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] |
ChannelBasicInfo Parameter Description
| Parameter | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| name | String | Channel name |
| channelPasswd | String | Channel password |
| scene | String | Scene: alone - live event, ppt - three-screen, topclass - large class, seminar - seminar |
| sceneText | String | Scene description |
| watchStatus | String | Watch page status: live - streaming, playback - replaying, end - ended, waiting - waiting, unStart - not started |
| watchStatusText | String | Watch page status description: streaming, replaying, ended, waiting, not started |
| watchUrl | String | Watch page URL |
21. Query Basic Information of All Channels
Description
查询账号下所有的频道基础信息列表
接口地址(仅做说明使用):https://api.polyv.net/live/v4/channel/basic/list
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testListAccountBasicV2() throws IOException, NoSuchAlgorithmException {
LiveListAccountBasicInfoV2Request liveListAccountBasicInfoV2Request = new LiveListAccountBasicInfoV2Request();
LiveListAccountBasicV2Response liveListAccountBasicV2Response;
try {
liveListAccountBasicInfoV2Request.setPageSize(2).setCurrentPage(2);
liveListAccountBasicV2Response = new LiveAccountServiceImpl().listAccountBasicInfoV2(
liveListAccountBasicInfoV2Request);
Assert.assertNotNull(liveListAccountBasicV2Response);
if (liveListAccountBasicV2Response != null) {
//to do something ......
log.debug("测试查询所有频道的基础信息成功 {}", JSON.toJSONString(liveListAccountBasicV2Response));
}
} 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
If the request is correct, a
LiveListAccountBasicV2Responseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields: [pic cannot be empty / msg cannot be empty] ]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 Name | Required | Type | Description |
|---|---|---|---|
| categoryIds | false | String | Category IDs, multiple IDs separated by commas |
| channelIds | false | String | Channel numbers, multiple channels separated by commas |
| watchStatus | false | String | Watch page status filter |
| startTime | false | Date | Live stream start time, query start time as a 13-digit timestamp |
| endTime | false | Date | Live stream start time, query end time as a 13-digit timestamp |
| orderBy | false | String | Sort field, default ascending by channel creation time. Options: startTimeDesc (descending by start time), startTimeAsc (ascending by start time), channelCreatedTimeDesc (descending by channel creation time) |
| currentPage | false | Integer | Page number, default is 1 [Corresponds to the pageNumber field in the API documentation] |
| pageSize | false | Integer | Number of data items displayed per page, default is 20 items per page |
| appId | false | String | POLYV user APP_ID, required when calling with multiple accounts (i.e., when initMultiAccount() is invoked for multi-account calls). Obtain by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required when calling with multiple accounts (i.e., when initMultiAccount() is invoked for multi-account calls). Obtain by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| contents | Array | List of query results [See LiveChannelBasic 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] |
LiveChannelBasic Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| name | String | Channel name |
| publisher | String | Host name |
| startTime | Date | Live broadcast start time, 0 when closed |
| pageView | Integer | Cumulative page views |
| likes | Integer | Number of likes on the viewing page |
| coverImg | String | Channel icon URL |
| splashImg | String | Splash page image URL |
| splashEnabled | String | Splash page toggle, values: Y: enabled, N: disabled |
| desc | String | Live broadcast description |
| maxViewer | Integer | Maximum number of concurrent online viewers |
| watchStatus | String | Viewing page status of the channel, values: live: live streaming, end: ended, playback: replaying, waiting: waiting, unStart: not started |
| watchStatusText | String | Viewing page status description: live streaming, replaying, ended, waiting, not started |
| onlineNum | Integer | Number of online users |
| bgImg | String | Warm-up image URL |
| categoryId | Integer | Category ID |
| videoList | Array | List of replay videos, sorted in descending order by addition time when multiple exist [See BasicVideoList parameter description for details] |
BasicVideoList Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| videoId | String | ID generated by the live streaming system (playback video in the video library) |
| videoPoolId | String | VOD video VID (playback video in the video library) |
22. Query Detailed Information of All Channels
Description
查询账号下所有频道详细信息列表,观看页状态与新版后台一致
接口地址(仅做说明使用):https://api.polyv.net/live/v4/channel/detail/list
Call Constraints
- The API call is subject to rate limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testListAccountDetailV2() throws IOException, NoSuchAlgorithmException {
LiveListAccountDetailV2Request liveListAccountDetailV2Request = new LiveListAccountDetailV2Request();
LiveListAccountDetailV2Response liveListAccountDetailV2Response;
try {
liveListAccountDetailV2Request.setPageSize(2).setCurrentPage(2);
liveListAccountDetailV2Response = new LiveAccountServiceImpl().listAccountDetailV2(
liveListAccountDetailV2Request);
Assert.assertNotNull(liveListAccountDetailV2Response);
if (liveListAccountDetailV2Response != null) {
//to do something ......
log.debug("测试查询所有频道的详细信息成功 {}", JSON.toJSONString(liveListAccountDetailV2Response));
}
} 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
If the request is correct, a
LiveListAccountDetailV2Responseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| categoryId | false | Integer | Category ID |
| watchStatus | false | String | Watch page status filter: live (live streaming), playback (playback), end (ended), waiting (waiting), unStart (not started) |
| keyword | false | String | Channel name, fuzzy search |
| orderBy | false | String | Sort field, default ascending by channel creation time. Options: startTimeDesc (descending by start time), startTimeAsc (ascending by start time), channelCreatedTimeDesc (descending by channel creation time) |
| currentPage | false | Integer | Page number, default is 1 [corresponds to the pageNumber field in the API documentation] |
| pageSize | false | Integer | Number of data items per page, default is 20 items per page |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtain by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtain by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| contents | Array | List of channel details [See LiveChannelDetail Parameter Description] |
| 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] |
LiveChannelDetail Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| name | String | Channel name |
| channelPasswd | String | Channel password |
| categoryId | Integer | Channel category ID |
| scene | String | Scene: alone - event live, ppt - three-screen, topclass - large class, seminar - seminar |
| sceneText | String | Scene description, e.g., Large Class |
| watchStatus | String | Watch page status: live - streaming, playback - replaying, end - ended, waiting - waiting, unStart - not started |
| watchStatusText | String | Watch page status description: streaming, replaying, ended, waiting, not started |
| watchUrl | String | Watch page URL |
| content | String | Live stream introduction |
| startTime | Date | Live stream start time |
| channelLogo | String | Channel icon |
| splashImg | String | Channel splash image |
| splashEnabled | String | Splash page toggle: Y - enabled, N - disabled |
| publisher | String | Host name |
| authSetting | Array | Live stream permission settings data transfer object see LiveAuthSetting parameter description |
LiveAuthSetting Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| rank | Integer | Used to set two viewing conditions for a channel, value is 1 or 2 (1 for primary condition, 2 for secondary condition) |
| userId | String | POLYV user ID, consistent with the one on the Polyv official website. Retrieval path: Official website -> Login -> Live Streaming (Development Settings) |
| globalSettingEnabled | String | Whether to enable global settings (Y/N) |
| enabled | String | Whether to enable viewing conditions (Y/N) |
| authType | String | Viewing condition type (1. No restriction none 2. Verification code viewing code 3. Paid viewing pay 4. Whitelist viewing phone 5. Registration viewing info 6. Share viewing wxshare 7. Custom authorization viewing custom 8. External authorization viewing external) |
| codeAuthTips | String | Prompt message for verification code viewing |
| authCode | String | Verification code for the verification code viewing method |
| qCodeTips | String | QR code prompt for the verification code viewing method [corresponds to the qcodeTips field in the API documentation] |
| qCodeImg | String | QR code image for the verification code viewing method [corresponds to the qcodeTips field in the API documentation] |
| payAuthTips | String | Prompt message for paid viewing |
| price | Float | Price for paid viewing |
| validTimePeriod | Integer | Duration of validity for paid viewing (days) |
| watchEndTime | Date | Expiration time for paid viewing; null indicates: one-time payment, permanently valid |
| authTips | String | Prompt message for whitelist viewing |
| infoAuthTips | String | Prompt message for registration viewing |
| customKey | String | Key for custom authorization viewing |
| customUri | String | Interface address for custom authorization viewing |
| externalKey | String | Interface address for custom authorization viewing |
| externalUri | String | Interface address for external authorization viewing |
| externalRedirectUri | String | Redirect address for external authorization viewing when users directly access the viewing page |
| directKey | String | Independent authorization key |
| trialWatchEnabled | String | Trial watch toggle, Y: enable trial watch, N: disable trial watch |
| trialWatchTime | Integer | Trial watch duration, in minutes |
| trialWatchEndTime | Date | Trial watch expiration date; null indicates permanently valid for the channel |
23. Query Global Callback Settings
Description
查询全局回调设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/global-setting/callback/get
Call Constraints
- The API call is subject to rate limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testGetLiveUserCallback() throws IOException, NoSuchAlgorithmException {
LiveGetUserCallbackRequest liveGetUserCallbackRequest = new LiveGetUserCallbackRequest();
LiveGetUserCallbackResponse liveGetUserCallbackResponse;
try {
liveGetUserCallbackResponse = new LiveAccountServiceImpl().getLiveUserCallback(liveGetUserCallbackRequest);
Assert.assertNotNull(liveGetUserCallbackResponse);
if (liveGetUserCallbackResponse != null) {
//to do something ......
log.debug("测试查询全局回调设置成功 {}", JSON.toJSONString(liveGetUserCallbackResponse));
}
} 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
If the request is correct, a
LiveGetUserCallbackResponseobject is returned, and Party B processes the business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found inPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID, required when making multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET, required when making multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| recordCallbackUrl | String | Recording generation callback URL |
| recordFileCallBackType | String | Callback recording file type: all - all playback videos, last - final playback video |
| recordCallbackVideoType | String | Callback file type: m3u8 - m3u8 file, mp4 - mp4 file, m3u8,mp4 - both m3u8 and mp4 files |
| playbackCallbackUrl | String | Successful transfer callback URL |
| rebirthVodCallbackEnabled | String | Remake courseware transfer VOD callback switch: Y - enabled, N - disabled |
| pptRecordCallbackUrl | String | Successful courseware remake callback URL |
| streamCallbackUrl | String | Live stream status change callback URL |
| channelBasicUpdateCallbackUrl | String | Channel/live room info modification callback URL |
| liveScanCallbackUrl | String | Live content review failure callback URL |
| chatUserStatusCallbackUrl | String | Live room user status callback URL |
| interactionCallbackUrl | String | Interaction feature callback URL |
| playbackCacheCallbackUrl | String | Live playback cache generation callback notification URL |
| playbackSettingCallbackUrl | String | Playback settings callback URL |
24. Modify Global Callback Settings
Description
修改全局回调设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/global-setting/callback/update
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testUpdateLiveUserCallback() throws IOException, NoSuchAlgorithmException {
LiveUpdateUserCallbackRequest liveUpdateUserCallbackRequest = new LiveUpdateUserCallbackRequest();
Boolean liveUpdateUserCallbackResponse;
try {
liveUpdateUserCallbackRequest.setPptRecordCallbackUrl("https://abc.cn/callback")
.setRecordCallbackVideoType("m3u8,mp4")
.setRecordFileCallBackType("all");
liveUpdateUserCallbackResponse = new LiveAccountServiceImpl().updateLiveUserCallback(
liveUpdateUserCallbackRequest);
Assert.assertNotNull(liveUpdateUserCallbackResponse);
if (liveUpdateUserCallbackResponse != null) {
//to do something ......
log.debug("测试修改全局回调设置成功 {}", JSON.toJSONString(liveUpdateUserCallbackResponse));
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. SeePloyvSdkException.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] ]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 |
|---|---|---|---|
| recordCallbackUrl | false | String | Recording generation callback URL |
| recordFileCallBackType | false | String | Callback recording file content: all - all playback videos, last - final playback video |
| recordCallbackVideoType | false | String | Callback file type: m3u8 - m3u8 file, mp4 - mp4 file, m3u8,mp4 - both m3u8 and mp4 files |
| playbackCallbackUrl | false | String | Transfer success callback URL |
| rebirthVodCallbackEnabled | false | String | Remake courseware transfer to VOD callback switch: Y - enabled, N - disabled |
| pptRecordCallbackUrl | false | String | Courseware remake success callback URL |
| streamCallbackUrl | false | String | Live stream status change callback URL |
| channelBasicUpdateCallbackUrl | false | String | Channel live room info modification callback URL |
| liveScanCallbackUrl | false | String | Live content review failure callback URL |
| playbackCacheCallbackUrl | false | String | Live playback cache generation callback notification URL |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtain by registering on the POLYV official website: Official website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtain by registering on the POLYV official website: Official website -> Login -> Live Streaming (Development Settings) |
Return Object Description
Modify the global callback settings to return the entity
25. Query Account Mic Usage Within a Time Range
Description
查询账号时间范围连麦使用量
接口地址(仅做说明使用):https://api.polyv.net/live/v4/statistics/mic/history/get
Call Constraints
API calls are subject to rate limits. Click here for details. For common call exceptions, click here for details.
Daily statistics on co-streaming usage. Due to the large volume of data and computation, the statistics are available with a two-day delay, meaning today's data can only be queried the day after tomorrow (summarized at 2:00 AM).
Unit Test
@Test
public void testGetMicDurationHistory() throws IOException, NoSuchAlgorithmException {
LiveGetMicDurationRequest liveGetMicDurationRequest = new LiveGetMicDurationRequest();
LiveGetMicDurationResponse liveGetMicDurationResponse;
try {
liveGetMicDurationResponse = new LiveAccountServiceImpl().getMicDuration(liveGetMicDurationRequest);
Assert.assertNotNull(liveGetMicDurationResponse);
if (liveGetMicDurationResponse != null) {
//to do something ......
log.debug("测试查询账号时间范围连麦使用量成功 {}", JSON.toJSONString(liveGetMicDurationResponse));
}
} 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
If the request is correct, a
LiveGetMicDurationResponseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| startTime | false | Date | Start time, 13-digit millisecond timestamp (only supports date precision) |
| endTime | false | Date | End time, 13-digit millisecond timestamp (only supports date precision) |
| appId | false | String | POLYV user APP_ID, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website. Path: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website. Path: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter | Type | Description |
|---|---|---|
| userId | String | User ID |
| history | Integer | Minutes of co-hosting usage |
26. Query Global Channel Settings
Description
查询全局频道设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/global-setting/switch/get
Call Constraints
- The API call is subject to rate limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testGetGlobalSwitch() throws IOException, NoSuchAlgorithmException {
LiveGetGlobalSwitchRequest liveGetGlobalSwitchRequest = new LiveGetGlobalSwitchRequest();
LiveGetGlobalSwitchResponse liveGetGlobalSwitchResponse;
try {
liveGetGlobalSwitchResponse = new LiveAccountServiceImpl().getGlobalSwitch(liveGetGlobalSwitchRequest);
Assert.assertNotNull(liveGetGlobalSwitchResponse);
if (liveGetGlobalSwitchResponse != null) {
//to do something ......
log.debug("测试查询全局频道设置成功 {}", JSON.toJSONString(liveGetGlobalSwitchResponse));
}
} 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
If the request is correct, a
LiveGetGlobalSwitchResponseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| channelConcurrencesEnabled | String | Maximum concurrent online users modification switch: Y - Enable, N - Disable |
| timelyConvertEnabled | String | Auto-transfer switch: Y - Enable, N - Disable |
| donateEnabled | String | Donation switch: Y - Enable, N - Disable |
| rebirthAutoUploadEnabled | String | Remastered courseware auto-transfer switch: Y - Enable, N - Disable |
| rebirthAutoConvertEnabled | String | Remastered courseware auto-remaster switch: Y - Enable, N - Disable |
| pptCoveredEnabled | String | Remastered courseware PPT full-screen switch: Y - Enable, N - Disable |
| coverImgType | String | Player cover setting: contain - Scale proportionally, cover - Stretch |
27. Modify Global Channel Settings
Description
修改全局频道设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/global-setting/switch/update
Call Constraints
- The API call is subject to rate limits. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testUpdateGlobalSwitch() throws IOException, NoSuchAlgorithmException {
LiveUpdateGlobalSwitchRequest liveUpdateGlobalSwitchRequest = new LiveUpdateGlobalSwitchRequest();
Boolean liveUpdateGlobalSwitchResponse;
try {
liveUpdateGlobalSwitchRequest.setChannelConcurrencesEnabled(LiveConstant.Flag.YES.getFlag())
.setCoverImgType("contain");
liveUpdateGlobalSwitchResponse = new LiveAccountServiceImpl().updateGlobalSwitch(
liveUpdateGlobalSwitchRequest);
Assert.assertNotNull(liveUpdateGlobalSwitchResponse);
if (liveUpdateGlobalSwitchResponse != null) {
//to do something ......
log.debug("测试修改全局频道设置成功 {}", JSON.toJSONString(liveUpdateGlobalSwitchResponse));
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| channelConcurrencesEnabled | false | String | Switch for modifying the maximum concurrent online users: Y - Enable, N - Disable |
| timelyConvertEnabled | false | String | Auto-transfer switch: Y - Enable, N - Disable |
| donateEnabled | false | String | Donation switch: Y - Enable, N - Disable |
| rebirthAutoUploadEnabled | false | String | Auto-transfer switch for remade courseware: Y - Enable, N - Disable |
| rebirthAutoConvertEnabled | false | String | Auto-remake switch for remade courseware: Y - Enable, N - Disable |
| pptCoveredEnabled | false | String | PPT full-screen switch for remade courseware: Y - Enable, N - Disable |
| coverImgType | false | String | Player cover setting: contain - Scale proportionally, cover - Stretch |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called for multi-account setup). Obtain by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called for multi-account setup). Obtain by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
Modify the global channel settings return entity
28. View Count Display Toggle
Description
查询观看页观看次数显示开关
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/global-setting/pv-show/get
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testGetPVShowSetting() throws IOException, NoSuchAlgorithmException {
LiveGetPVShowSettingRequest liveGetPVShowSettingRequest = new LiveGetPVShowSettingRequest();
LiveGetPVShowSettingResponse liveGetPVShowSettingResponse;
try {
liveGetPVShowSettingResponse = new LiveAccountServiceImpl().getPVShowSetting(liveGetPVShowSettingRequest);
Assert.assertNotNull(liveGetPVShowSettingResponse);
if (liveGetPVShowSettingResponse != null) {
//to do something ......
log.debug("测试查询观看次数显示开关成功 {}", JSON.toJSONString(liveGetPVShowSettingResponse));
}
} 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
If the request is correct, a
LiveGetPVShowSettingResponseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| enabled | String | Toggle for displaying view count on the watch page: Y = enabled, N = disabled |
29. Toggle for Displaying View Count
Description
修改观看页观看次数显示开关
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/global-setting/pv-show/update
Call Constraints
- The API call is subject to frequency limits. For details, see here. For common call exceptions, see here.
Unit Testing
@Test
public void testUpdatePVShowSetting() throws IOException, NoSuchAlgorithmException {
LiveUpdatePVShowSettingRequest liveUpdatePVShowSettingRequest = new LiveUpdatePVShowSettingRequest();
Boolean liveUpdatePVShowSettingResponse;
try {
liveUpdatePVShowSettingRequest.setEnabled(LiveConstant.Flag.YES.getFlag());
liveUpdatePVShowSettingResponse = new LiveAccountServiceImpl().updatePVShowSetting(
liveUpdatePVShowSettingRequest);
Assert.assertNotNull(liveUpdatePVShowSettingResponse);
if (liveUpdatePVShowSettingResponse != null) {
//to do something ......
log.debug("测试修改观看次数显示开关成功 {}", JSON.toJSONString(liveUpdatePVShowSettingResponse));
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. SeePloyvSdkException.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] ]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 |
|---|---|---|---|
| enabled | true | String | Toggle for displaying view count on the watch page: Y for enabled, N for disabled |
| appId | false | String | POLYV user APP_ID, required when making multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required when making multi-account calls (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
Modify the view count display toggle to return an entity
30. Query Footer Settings
Description
查询全局页脚设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/global-setting/footer/get
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testGetFooterSetting() throws IOException, NoSuchAlgorithmException {
LiveGetFooterSettingRequest liveGetFooterSettingRequest = new LiveGetFooterSettingRequest();
LiveGetFooterSettingResponse liveGetFooterSettingResponse;
try {
liveGetFooterSettingResponse = new LiveAccountServiceImpl().getFooterSetting(liveGetFooterSettingRequest);
Assert.assertNotNull(liveGetFooterSettingResponse);
if (liveGetFooterSettingResponse != null) {
//to do something ......
log.debug("测试查询页脚设置成功 {}", JSON.toJSONString(liveGetFooterSettingResponse));
}
} 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
If the request is correct, return a
LiveGetFooterSettingResponseobject, based on which the B-side handles the business logic.If request parameter validation fails, a
PloyvSdkExceptionis thrown. SeePloyvSdkException.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] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| userId | String | POLYV user ID, consistent with the one on the Polyv official website. Retrieval path: Official website -> Login -> Live Streaming (Developer Settings) |
| showFooterEnabled | String | Whether to enable the footer. Y: Enable, N: Disable |
| footerText | String | Footer text |
| footTextLinkProtocol | String | Footer link protocol header |
| footTextLinkUrl | String | Footer link URL |
31. Modify Footer Settings
Description
修改全局页脚设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/global-setting/footer/update
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testUpdateFooterSetting() throws IOException, NoSuchAlgorithmException {
LiveUpdateFooterSettingRequest liveUpdateFooterSettingRequest = new LiveUpdateFooterSettingRequest();
Boolean liveUpdateFooterSettingResponse;
try {
liveUpdateFooterSettingRequest.setShowFooterEnabled(LiveConstant.Flag.YES.getFlag())
.setFooterText("保利威提供技术支持")
.setFootTextLinkProtocol("https://")
.setFootTextLinkUrl("www.polyv.net");
liveUpdateFooterSettingResponse = new LiveAccountServiceImpl().updateFooterSetting(
liveUpdateFooterSettingRequest);
Assert.assertNotNull(liveUpdateFooterSettingResponse);
if (liveUpdateFooterSettingResponse != null) {
//to do something ......
log.debug("测试修改页脚设置成功 {}", JSON.toJSONString(liveUpdateFooterSettingResponse));
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| showFooterEnabled | false | String | Whether to enable the footer: Y for enabled, N for disabled |
| footerText | false | String | Footer text, maximum length 12 |
| footTextLinkProtocol | false | String | Footer link protocol header: http:// or https:// |
| footTextLinkUrl | false | String | Footer link URL, maximum length 50, without protocol (e.g., www.polyv.net) |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
Modify footer settings to return entity
32. Query Default Template Settings for Watch Page
Description
查询观看页默认模板设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/template/page-setting/get
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testGetPageSetting() throws IOException, NoSuchAlgorithmException {
LiveGetPageSettingRequest liveGetPageSettingRequest = new LiveGetPageSettingRequest();
LiveGetPageSettingResponse liveGetPageSettingResponse;
try {
liveGetPageSettingResponse = new LiveAccountServiceImpl().getPageSetting(liveGetPageSettingRequest);
Assert.assertNotNull(liveGetPageSettingResponse);
if (liveGetPageSettingResponse != null) {
//to do something ......
log.debug("测试查询观看页默认模板设置成功 {}", JSON.toJSONString(liveGetPageSettingResponse));
}
} 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
If the request is correct, a
LiveGetPageSettingResponseobject is returned, and the B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| autoPlayEnabled | String | Auto-play switch, Y: enabled, N: disabled |
| barrageEnabled | String | Barrage switch, Y: enabled, N: disabled |
| barrageSpeed | String | Barrage speed, 340: slow, 270: relatively slow, 200: standard, 130: relatively fast, 60: fast |
| bookingEnabled | String | WeChat booking feature switch, Y: enabled, N: disabled |
| closePreviewEnabled | String | Watch page switch, Y: do not display watch page (only allow SDK-integrated viewing), N: display watch page |
| flashPlayerEnabled | String | Flash player switch, Y: enabled, N: disabled |
| forbidFirefoxEnabled | String | Forbid Firefox switch, Y: enabled, N: disabled |
| mobileAudioEnabled | String | Audio/video switching switch, Y: enabled, N: disabled |
| mobilePvShowLocation | String | View count display location on mobile, player: player, desc: live stream description |
| mobileWatchEnabled | String | Mobile watch page switch, Y: enabled, N: disabled |
| pvShowEnabled | String | View count switch, Y: enabled, N: disabled |
| recordingProtectEnabled | String | Anti-popup playback switch, Y: enabled, N: disabled |
| showCountdownEnabled | String | Display "Next Session" countdown in replay switch value, Y: enabled, N: disabled |
| switchPlayerEnabled | String | Allow viewers to switch between H5 and Flash players, Y: allowed, N: not allowed; this value does not take effect when the Flash player switch is N |
| viewerVerificationEnabled | String | Viewer real-name authentication switch, Y: enabled, N: disabled |
| watchFeedbackEnabled | String | Viewer complaint switch, Y: enabled, N: disabled |
| watchLangType | String | Watch page language, zh_CN: Chinese, en: English, follow_browser: follow browser |
| watchLayout | String | Watch page layout, ppt-document-primary, video-primary, only-video, follow-teacher |
33. Modify Default Template Settings for Watch Page
Description
修改观看页默认模板设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/template/page-setting/update
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testUpdatePageSetting() throws IOException, NoSuchAlgorithmException {
LiveUpdatePageSettingRequest liveUpdatePageSettingRequest = new LiveUpdatePageSettingRequest();
Boolean liveUpdatePageSettingResponse;
try {
liveUpdatePageSettingRequest.setAutoPlayEnabled("Y");
liveUpdatePageSettingResponse = new LiveAccountServiceImpl().updatePageSetting(
liveUpdatePageSettingRequest);
Assert.assertNotNull(liveUpdatePageSettingResponse);
if (liveUpdatePageSettingResponse != null) {
//to do something ......
log.debug("测试修改观看页默认模板设置成功 {}", JSON.toJSONString(liveUpdatePageSettingResponse));
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]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 Name | Required | Type | Description |
|---|---|---|---|
| autoPlayEnabled | false | String | Auto-play switch, Y: enabled, N: disabled |
| barrageEnabled | false | String | Barrage switch, Y: enabled, N: disabled |
| barrageSpeed | false | String | Barrage speed, 340: slow, 270: relatively slow, 200: standard, 130: relatively fast, 60: fast |
| bookingEnabled | false | String | WeChat booking function switch, Y: enabled, N: disabled |
| closePreviewEnabled | false | String | Watch page switch, Y: do not display watch page (only allow SDK-integrated viewing), N: display watch page |
| flashPlayerEnabled | false | String | Flash player switch, Y: enabled, N: disabled |
| forbidFirefoxEnabled | false | String | Forbid Firefox switch, Y: enabled, N: disabled |
| mobileAudioEnabled | false | String | Audio/video switching switch, Y: enabled, N: disabled |
| mobilePvShowLocation | false | String | Display location of view count on mobile, player: player, desc: live stream description |
| mobileWatchEnabled | false | String | Mobile watch page switch, Y: enabled, N: disabled |
| pvShowEnabled | false | String | View count switch, Y: enabled, N: disabled |
| recordingProtectEnabled | false | String | Anti-popup playback switch, Y: enabled, N: disabled |
| showCountdownEnabled | false | String | Display "next session" countdown in replay switch value, Y: enabled, N: disabled |
| switchPlayerEnabled | false | String | Allow viewers to switch between H5 and Flash players, Y: allowed, N: not allowed; this value is invalid when the Flash player switch is N |
| viewerVerificationEnabled | false | String | Viewer real-name authentication switch, Y: enabled, N: disabled |
| watchFeedbackEnabled | false | String | Viewer complaint switch, Y: enabled, N: disabled |
| watchLangType | false | String | Watch page language, zh_CN: Chinese, en: English, follow_browser: follow browser |
| watchLayout | false | String | Watch page layout, ppt-document-primary, video-primary, only-video, follow-teacher |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls), obtained by registering on the POLYV official website, path: Official website -> Login -> Live Stream (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls), obtained by registering on the POLYV official website, path: Official website -> Login -> Live Stream (Development Settings) |
Return Object Description
true indicates modification succeeded, false indicates modification failed.
34. Query Replay Videos for All Channels
Description
查询账号下回放列表和点播列表, 注意:不包括暂存列表
接口地址(仅做说明使用):https://api.polyv.net/live/v3/user/playback/list
Call Constraints
- The API call is subject to rate limits. Click here for details. For common call exceptions, click here for details.
Unit Testing
@Test
public void testGetUserPlaybackList() throws IOException, NoSuchAlgorithmException {
LiveListUserPlaybackRequest liveListUserPlaybackRequest = new LiveListUserPlaybackRequest();
LiveListUserPlaybackResponse liveListUserPlaybackResponse;
try {
String channelId = super.createChannel();
liveListUserPlaybackRequest.setChannelId(channelId);
liveListUserPlaybackResponse = new LiveAccountServiceImpl().getUserPlaybackList(
liveListUserPlaybackRequest);
Assert.assertNotNull(liveListUserPlaybackResponse);
if (liveListUserPlaybackResponse != null) {
//to do something ......
log.debug("测试查询所有频道的回放视频成功 {}", JSON.toJSONString(liveListUserPlaybackResponse));
}
} 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
If the request is correct, it returns a
LiveListUserPlaybackResponseobject, based on which the B-side processes business logic.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]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 | false | String | Channel ID. If not provided, all replay videos under the account will be queried. |
| page | false | String | Page number, defaults to 1. |
| pageSize | false | String | Number of items per page, defaults to 20, valid range is 1-1000. |
| order | false | String | Sorting rule. Values: timeDesc (descending by createdTime), rankDesc (descending by rank), time (ascending by createdTime), rank (ascending by rank). Default is timeDesc. |
| listType | false | String | playback: replay list, vod: video-on-demand list. Default is playback. |
| appId | false | String | POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the Polyv official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
| Parameter | Type | Description |
|---|---|---|
| contents | Array | Returns the list of playback video information on successful response See UserPlayback parameter description |
| 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] |
UserPlayback Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| videoId | String | ID generated by the live streaming system (playback video in the video library) |
| videoPoolId | String | VOD video VID (playback video in the video library) |
| userId | String | POLYV user ID, consistent with the one on the Polyv official website. Retrieval path: Official website -> Login -> Live Streaming (Development Settings) |
| channelId | String | Live channel number corresponding to the playback video |
| title | String | Video title |
| firstImage | String | Video thumbnail |
| duration | String | Video length, format: HH:mm:ss |
| myBr | String | Default video playback quality: 1: Smooth, 2: HD, 3: Ultra HD |
| qid | String | Visitor information collection ID |
| seed | Integer | Video encryption status: 1 indicates encrypted, 0 indicates non-encrypted |
| orderTime | Integer | Sorting field for associated VOD videos [corresponds to the ordertime field in the API documentation] |
| createdTime | Date | Date added as a playback video |
| lastModified | Date | Last modification date of the video |
| rank | Integer | Sorting value, higher value indicates higher priority |
| asDefault | String | Whether it is the default playback video, values: Y/N, Y: Yes, N: No |
| url | String | Video playback URL. Note: If the video is encrypted, this URL will be inaccessible. |
| channelSessionId | String | Used for PPT data requests, related to PPT live streaming playback; value is null for regular live streaming playback |
| status | String | Completion status of transferring to VOD video: Completed: Y, Not completed: N |
| fileUrl | String | Video URL |
| fileId | String | Temporary fileId of the playback video before transfer |
| startTime | Date | Live streaming start time |
| liveType | String | Live streaming type: alone: Event live, ppt: Three-screen, topclass: Large class, seminar: Seminar |
| width | Integer | Video width |
| height | Integer | Video height |
| origin | String | Source of the transferred file: manual: Manual recording, auto: Automatic recording, merge: Merged, clip: Clipped |
| callbackUrl | String | Callback URL set when transferring the video |
| errorCount | Integer | Number of processing failures |
| lang | String | Language: zh_CN: Chinese, EN: English |
| videoIdEN | String | English playback videoId |
| enFileUrl | String | English playback file URL |
| mergeInfo | String | Video merge information [corresponds to the mergeinfo field in the API documentation] |
| watchUrl | String | URL to watch the playback video |
35. Query Default Template Screen Recording Prevention Settings
Description
查询防录屏默认模板设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/template/marquee/get
Call Constraints
- The API call has a frequency limit. Click here for details. For common call exceptions, click here for details.
Unit Testing
@Test
public void testGetMarquee() throws IOException, NoSuchAlgorithmException {
LiveGetMarqueeRequest liveGetMarqueeRequest = new LiveGetMarqueeRequest();
LiveGetMarqueeResponse liveGetMarqueeResponse;
try {
liveGetMarqueeResponse = new LiveAccountServiceImpl().getMarquee(liveGetMarqueeRequest);
Assert.assertNotNull(liveGetMarqueeResponse);
if (liveGetMarqueeResponse != null) {
//to do something ......
log.debug("测试查询默认模板防录屏设置成功 {}", JSON.toJSONString(liveGetMarqueeResponse));
}
} 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
If the request is correct, a
LiveGetMarqueeResponseobject is returned. The B-side processes business logic based on this object.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings). |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| enable | String | Screen recording prevention switch: Y - On, N - Off |
| antiRecordType | String | Screen recording prevention method: marquee - scrolling text, watermark - watermark |
| modelType | String | Screen recording prevention type: fixed - fixed, nickname - username, diyurl - custom URL |
| autoZoomEnabled | String | Custom zoom switch: Y - On, N - Off |
| content | String | Fixed value: set content; Custom URL: URL |
| opacity | Integer | Transparency: Marquee transparency range 0-99; Watermark transparency range 0-100 |
| doubleEnabled | String | Dual marquee switch: Y - On, N - Off |
| fontColor | String | Marquee font color, color value, e.g., #FFFFFF |
| fontSize | String | Font size: When screen recording prevention method is marquee: set a value, range 1-256; When screen recording prevention method is watermark: small - small, middle - medium, large - large |
| showMode | String | Marquee display mode: roll - scrolling, flicker - flashing |
36. Query Default Template Playback Settings
Description
查询回放默认模板设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/template/playback-setting/get
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testGetTemplatePlaybackSetting() throws IOException, NoSuchAlgorithmException {
LiveGetTemplatePlaybackSettingRequest liveGetTemplatePlaybackSettingRequest =
new LiveGetTemplatePlaybackSettingRequest();
LiveGetTemplatePlaybackSettingResponse liveGetTemplatePlaybackSettingResponse;
try {
liveGetTemplatePlaybackSettingResponse = new LiveAccountServiceImpl().getTemplatePlaybackSetting(
liveGetTemplatePlaybackSettingRequest);
Assert.assertNotNull(liveGetTemplatePlaybackSettingResponse);
if (liveGetTemplatePlaybackSettingResponse != null) {
//to do something ......
log.debug("测试查询默认模板回放设置成功 {}", JSON.toJSONString(liveGetTemplatePlaybackSettingResponse));
}
} 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
If the request is correct, return a
LiveGetTemplatePlaybackSettingResponseobject, based on which the B-side processes the business logic.If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found inPloyvSdkException.getMessage(), for example:[ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| appId | false | String | POLYV user APP_ID, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required when calling with multiple accounts (i.e., when initMultiAccount() has been called to set up multi-account invocation). Obtain it by registering on the POLYV official website: Official Website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| playbackEnabled | String | Playback toggle: Y = enabled, N = disabled |
| type | String | Playback mode on the viewing page: single = single video, list = list playback |
| origin | String | Playback video source: record = temporary storage, playback = playback list, vod = VOD list |
| sectionEnabled | String | Chapter toggle: Y = enabled, N = disabled |
| chatPlaybackEnabled | String | Chat playback toggle: Y = enabled, N = disabled |
37. Modify Default Template Screen Recording Prevention Settings
Description
更新防录屏默认模板设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/template/marquee/update
Call Constraints
- The API call has a frequency limit. See details. For common call exceptions, see details.
Unit Testing
@Test
public void testUpdateMarquee() throws IOException, NoSuchAlgorithmException {
LiveUpdateMarqueeRequest liveUpdateMarqueeRequest = new LiveUpdateMarqueeRequest();
Boolean liveUpdateMarqueeResponse;
try {
liveUpdateMarqueeRequest.setAntiRecordType("marquee");
liveUpdateMarqueeRequest.setAutoZoomEnabled("Y");
liveUpdateMarqueeRequest.setContent("测试跑马灯内容test");
liveUpdateMarqueeRequest.setDoubleEnabled("N");
liveUpdateMarqueeRequest.setEnable("Y");
liveUpdateMarqueeRequest.setFontColor("#ff4d4f");
liveUpdateMarqueeRequest.setFontSize("20");
liveUpdateMarqueeRequest.setModelType("fixed");
liveUpdateMarqueeRequest.setOpacity(80);
liveUpdateMarqueeRequest.setShowMode("flicker");
liveUpdateMarqueeResponse = new LiveAccountServiceImpl().updateMarquee(liveUpdateMarqueeRequest);
Assert.assertNotNull(liveUpdateMarqueeResponse);
if (liveUpdateMarqueeResponse != null) {
//to do something ......
log.debug("测试修改默认模板防录屏设置成功 {}", JSON.toJSONString(liveUpdateMarqueeResponse));
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 |
|---|---|---|---|
| enable | true | String | Screen recording prevention switch Y: Enable N: Disable |
| antiRecordType | false | String | Screen recording prevention method, required when the screen recording prevention switch is enabled marquee: Marquee watermark: Watermark |
| modelType | false | String | Screen recording prevention type, required when the screen recording prevention switch is enabled. Setting a custom URL is invalid for the watermark method. fixed: Fixed nickname: Username diyurl: Custom URL setting, only valid for the marquee method |
| content | false | String | When the screen recording prevention type is fixed, this is the set content. When it is a custom URL, this is the URL, which must include http:// or https://. This parameter can be omitted when the screen recording prevention type is the login username, but is required for fixed values and custom URL settings. |
| opacity | false | Integer | Marquee transparency, range 0-99 Watermark transparency, range 0-100 |
| fontSize | false | String | Font size When the screen recording prevention method is marquee: Set a value, range 1-256 When the screen recording prevention method is watermark: small: Small middle: Medium large: Large |
| fontColor | false | String | Marquee font color, color value, e.g., #FFFFFF |
| showMode | false | String | Marquee display mode roll: Scrolling flicker: Flashing |
| doubleEnabled | false | String | Dual marquee switch Y: Enable N: Disable |
| autoZoomEnabled | false | String | Custom zoom switch Y: Enable N: Disable |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtained by registering on the Polyv official website, path: Official website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtained by registering on the Polyv official website, path: Official website -> Login -> Live Streaming (Development Settings) |
Return Object Description
Modify the default template's anti-screen recording settings to return an entity
38. Modify Default Template Playback Settings
Description
修改回放默认模板设置
接口地址(仅做说明使用):https://api.polyv.net/live/v4/user/template/playback-setting/update
Call Constraints
- The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].
Unit Testing
@Test
public void testUpdatePlaybackSetting() throws IOException, NoSuchAlgorithmException {
LiveUpdatePlaybackSettingRequest liveUpdatePlaybackSettingRequest = new LiveUpdatePlaybackSettingRequest();
Boolean liveUpdatePlaybackSettingResponse;
try {
liveUpdatePlaybackSettingRequest.setChatPlaybackEnabled("Y");
liveUpdatePlaybackSettingRequest.setOrigin("vod");
liveUpdatePlaybackSettingRequest.setPlaybackEnabled("N");
liveUpdatePlaybackSettingRequest.setSectionEnabled("N");
liveUpdatePlaybackSettingRequest.setType("list");
liveUpdatePlaybackSettingResponse = new LiveAccountServiceImpl().updatePlaybackSetting(
liveUpdatePlaybackSettingRequest);
Assert.assertNotNull(liveUpdatePlaybackSettingResponse);
if (liveUpdatePlaybackSettingResponse != null) {
//to do something ......
log.debug("测试修改默认模板回放设置成功 {}", JSON.toJSONString(liveUpdatePlaybackSettingResponse));
}
} 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
If the request is correct, a Boolean object is returned, and the B-side processes business logic based on this object.
If request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found viaPloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed field [pic cannot be empty / msg cannot be empty] ]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 Name | Required | Type | Description |
|---|---|---|---|
| playbackEnabled | false | String | Playback switch: Y - enabled, N - disabled |
| type | false | String | Playback mode on the viewing page: single - single video, list - list playback |
| origin | false | String | Playback video source: record - temporary storage, playback - playback list, vod - VOD list |
| sectionEnabled | false | String | Chapter switch: Y - enabled, N - disabled |
| chatPlaybackEnabled | false | String | Chat playback switch: Y - enabled, N - disabled |
| appId | false | String | POLYV user APP_ID. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtain it by registering on the POLYV official website. Path: Official website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET. This parameter is required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtain it by registering on the POLYV official website. Path: Official website -> Login -> Live Streaming (Development Settings) |
Return Object Description
Modify the default template playback settings to return the entity
