Polyv Help Center

Help Center

Modify Channel Feature Switch Status

Updated: 2026-06-26 14:52:30

API Description

1、修改功能开关设置,可修改全局开关设置或频道开关设置
2、接口支持https协议
3、开关类型若未注明默认Y表示开启;isClosePreview当enabled值为Y时,表示的是关闭系统观看页;closeDanmu当enabled值为Y时,表示的是关闭弹幕;closeChaterList当enabled值为Y时,表示的是关闭在线列表

API URL

http://api.polyv.net/live/v3/channel/switch/update

Online API Call

Request Method

POST

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. 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 stored or used directly on the client side. 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 passed, modifies global settings.
type true String Switch type See details: type field description
enabled true String Switch value, values Y/N. Specific explanation depends on type. See details: type field description
type Parameter Description
Parameter Name 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 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: Close
N: Open
consultingMenu Whether to enable consultation/asking questions
closeDanmu Whether to close the danmaku feature
Y: Close
N: Open
barrageSpeed Danmaku speed
quickest: Fast
quicker: Faster
slowest: Slow
slower: Slower
standard: Standard
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 (enabling is ineffective if the Q&A feature is not activated)
filterManagerMsgEnabled Filter chat room admin messages switch, i.e., view chat room with host messages only
showCustomMessageEnabled Display custom messages switch
chatOnlineNumberEnable Online user count switch
pvShowEnabled Whether to display "Visit Count", Y-Enable, N-Disable
recordAutoConvertEnabled Configure channel auto-save switch, Y-Enable, N-Disable

Example

http://api.polyv.net/live/v3/channel/switch/update

Form Parameters:

appId=frlr1zazn3&sign=F34B58AA1EE744A5E4D6B64F8554337E&type=autoPlay&enabled=N&channelId=2220949&timestamp=1621840863110

Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure See details: Global Error Description
status String Response status text
message String Response description, provides error details when code is 400 or 500
data String Returns true on success, returns empty string on failure

Java Request Example

For quick integration of basic code, please download the relevant dependency source code. Click here to download source code. After downloading, add it to your own source project. The test cases HttpUtil.java and LiveSignUtil.java are included in the download 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 testSwitchUpdate() 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/update";
   String channelId= String.valueOf(2191569);
    String type="mobileWatch";
    String enabled="Y";

    //http 调用逻辑
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("type", type);
    requestMap.put("enabled", enabled);
   requestMap.put("channelId", channelId);
    requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
    String response = HttpUtil.postFormBody(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":true
}

Error Example

{
    "code": 400,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询
在线咨询