Query Channel Feature Switch Status
Updated: 2026-06-26 14:52:30
Interface Description
1、查询开关状态,可查询全局开关状态或频道开关状态
2、接口支持https协议
3、isClosePreview当enabled值为Y时,表示的是关闭系统观看页;closeDanmu当enabled值为Y时,表示的是关闭弹幕;closeChaterList当enabled值为Y时,表示的是关闭在线列表
4、当频道非三分屏场景时才返回:mobileAudio移动端音频开关,redPack红包开关,praise点赞语开关,chatPlayBack聊天回放开关
Interface URL
http://api.polyv.net/live/v3/channel/switch/get
Request Method
GET
Interface Constraints
- The interface supports both HTTP and HTTPS. HTTPS is recommended for security. There is a frequency limit on interface calls. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details: Get Secret Key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be saved or used directly on the client. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See details: Signature Generation Rules |
| channelId | false | String | Channel ID. If not provided, queries the global settings. |
Example
https://api.polyv.net/live/v3/channel/switch/get?appId=frlr1zazn3&sign=0EBE4C9FCAEBB325135F0945497C7792&channelId=2191569×tamp=1621840901604
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code. 200 indicates success, non-200 indicates failure. See details: Global Error Description |
| status | String | Response status text |
| message | String | Response description. When code is 400 or 500, provides additional error details. |
| data | Array | Array of switch status information on successful response. See details: Data Field Description |
Data Parameter Description
| Parameter | Type | Description |
|---|---|---|
| type | String | Switch type. See details: Type Field Description |
| enabled | String | Switch value, Y/N. Specific meaning depends on the type. See details: Type Field Description |
Type Parameter Description
| Parameter | Description |
|---|---|
| isClosePreview | Whether to close the system viewing page. Y: Close N: Open |
| mobileWatch | Whether to enable the mobile system viewing page. |
| mobileAudio | Whether to enable audio/video switching on mobile. |
| autoPlay | Whether to enable auto-play for the player. |
| 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. |
| chatPlayBack | Whether to enable chat replay. |
| closeChaterList | Whether to close the online user list. Y: Close N: Open |
| consultingMenu | Whether to enable consultation/asking questions. |
| closeDanmu | Whether to close the danmaku (bullet comments) function. Y: Close N: Open |
| praise | Whether to enable the praise phrase function. |
| welcome | Whether to enable the welcome message function. |
| sendFlowersEnabled | Whether to enable the flower sending function. |
| pushSharingEnabled | Whether to enable the streaming-side sharing switch. |
| viewerSendImgEnabled | Whether to allow viewers to send images. |
| qaMenuEnabled | Whether to enable the Q&A function. Y: Enable N: Disable |
| filterManagerMsgEnabled | Filter chat room manager messages, i.e., view chat room host-only mode. |
| showCustomMessageEnabled | Whether to display custom messages. |
| chatOnlineNumberEnable | Online user count switch. |
| recordAutoConvertEnabled | Whether the channel allows automatic recording conversion. If empty, the account-level setting determines this. Y means auto-convert, N means not. |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own source project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(AccountTest.class);
/**
* 查询频道的功能开关状态
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testSwitchGet() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际
String appId = super.appId;
String appSecret = super.appSecret;
String userId = super.userId;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url="https://api.polyv.net/live/v3/channel/switch/get";
String channelId= String.valueOf(2191569);
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试查询频道的功能开关状态,返回值:{}", response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code":200,
"status":"success",
"message":"",
"data":[
{
"type":"isClosePreview",
"enabled":"N"
},
{
"type":"mobileWatch",
"enabled":"Y"
},
{
"type":"autoPlay",
"enabled":"Y"
},
{
"type":"booking",
"enabled":"Y"
},
{
"type":"shareBtnEnabled",
"enabled":"Y"
},
{
"type":"rtsEnabled",
"enabled":"N"
},
{
"type":"chat",
"enabled":"Y"
},
{
"type":"consultingMenu",
"enabled":"Y"
},
{
"type":"closeDanmu",
"enabled":"N"
},
{
"type":"welcome",
"enabled":"Y"
},
{
"type":"viewerSendImgEnabled",
"enabled":"N"
},
{
"type":"sendFlowersEnabled",
"enabled":"Y"
},
{
"type":"pushSharingEnabled",
"enabled":"Y"
},
{
"type":"closeChaterList",
"enabled":"Y"
}
]
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
