Polyv Help Center

Help Center

Modify Channel Information

Updated: 2026-08-05 16:13:23

API Description

1、修改频道的相关设置
2、(channelId, timestamp, appId)参与sign签名,并和sign一起通过url传递,请求体参数不参与签名,通过post请求体传递【请设置请求头contentType:application/json】
3、接口支持https

API URL

http://api.polyv.net/live/v3/channel/basic/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 on obtaining keys
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 never be used directly on the client side. All APIs must be called from the customer's own server to relay requests to the POLYV server for response data. See signature generation rules
channelId true String Channel ID

Request Body Parameter Description

Parameter Required Type Description
basicSetting false Object Basic settings See basicSetting field description
authSettings false Array Viewing condition settings See authSettings field description
basicSetting Parameter Description
Parameter Required Type Description
name false String Channel name, max 100 characters
channelPasswd false String Channel password, max 16 characters
publisher false String Host name
startTime false Long Live start time, 13-digit timestamp. Set to 0 to disable display of start time
endTime false Long Live end time, 13-digit timestamp. [Note: Only used for display when the stream is not started; does not affect the instructor's ability to start streaming]
resetEndTime false String Clear end time switch. Y: Clear, N: Do not clear (When Y, the endTime field must be empty or not provided)
pageView false Integer Cumulative view count
likes false Integer Number of likes
coverImg false String Live room icon URL. Images not on Polyv's domain must first be uploaded via Upload all channel decoration image materials
splashImg false String Splash page image URL. Images not on Polyv's domain must first be uploaded via Upload all channel decoration image materials
splashEnabled false String Splash page switch
Y: Enable
N: Disable
desc false String Live stream description
consultingMenuEnabled false String Consultation/Question switch
Y: Enable
N: Disable
maxViewerRestrict false String Limit maximum viewers
Y: Yes
N: No
maxViewer false Integer Maximum concurrent viewers
categoryId false String Channel category ID. If not submitted, the category is not modified. (Category ID can be obtained via the "Query Live Categories" API)
linkMicLimit false Integer Maximum number of participants in co-streaming, up to 16 (range >= -1, <= globally set co-streaming limit). -1: Use global setting, 0: Disable co-streaming
operation false String Whether to add relay association (Note: Requires the channel relay feature to be enabled)
Y: Add association
N: Remove association
receiveChannelIds false String Receiving relay channel IDs, separated by commas "," (Note: Requires the channel relay feature to be enabled. A channel can be associated with a maximum of 500 receiving relay channels)
closeDanmu false String Disable danmaku switch
N: Do not disable
Y: Disable
showDanmuInfoEnabled false String Default display of danmaku info switch
Y: Show
N: Hide
pureRtcEnabled false String Enable low-latency streaming switch. Leave empty to not modify the field. Cannot be modified during a live stream.
Y: Yes
N: No
customTeacherId false String Custom instructor ID, up to 32 ASCII visible characters
labelData false Array Array of label IDs
authSettings Parameter Description
Parameter Required Type Description
rank true Integer Primary viewing condition is 1, secondary viewing condition is 2
enabled true String Enable conditional viewing N: Disable Y: Enable
authType false String pay: Paid viewing code: Verification code viewing phone: Whitelist viewing info: Registration viewing custom: Custom authorization viewing external: External authorization viewing direct: Independent authorization viewing. Required when modifying specific viewing condition configurations; if not provided, only the enabled field is modified
payAuthTips false String When authType is pay, optional parameter. Welcome title
price false Float When authType is pay, required parameter. Price in RMB
watchEndTime false String When authType is pay, optional parameter. Paid validity end date, format is 13-digit timestamp
validTimePeriod false Integer When authType is pay, optional parameter. Paid validity duration in days. If both watchEndTime and validTimePeriod are empty, the payment is permanently valid
authCode false String When authType is code, required parameter. Verification code
qcodeTips false String When authType is code, optional parameter. Prompt text
qcodeImg false String When authType is code, optional parameter. Official account QR code URL
authTips false String When authType is phone, optional parameter. Prompt text
whiteListEntryText false String When authType is phone, optional parameter. Whitelist entry text
whiteListInputTips false String When authType is phone, optional parameter. Whitelist input prompt
infoFields false Array When authType is info, required parameter. Registration viewing information, max 5 items See infoFields field description
infoAuthTips false String When authType is info, optional parameter. Welcome title
infoDesc false String When authType is info, optional parameter. Prompt information
infoEntryText false String When authType is info, optional parameter. Entry text
externalKey false String When authType is external, required parameter. SecretKey
externalUri false String When authType is external, required parameter. Custom URL
externalRedirectUri false String When authType is external, optional parameter. Redirect URL
extTrialWatchEnabled false String When authType is external, enable external authorization trial watch switch
Y: Enable
N: Disable. When modifying this field, authType=external must be provided simultaneously
extTrialWatchTime false Integer When authType is external and extTrialWatchEnabled is Y, required. Trial watch duration in minutes, must be greater than 0
extTrialWatchEndTime false String When authType is external and extTrialWatchEnabled is Y, optional. Trial watch validity end time, format yyyy-MM-dd HH:mm; if not provided, it is permanently valid
extTrialRedirectUrl false String When authType is external and extTrialWatchEnabled is Y, required. Redirect URL after trial watch expires, must be a valid HTTP or HTTPS URL, max 1024 characters
customKey false String When authType is custom, required parameter. SecretKey
customUri false String When authType is custom, required parameter. Custom URL
directKey false String When authType is direct, required parameter. Independent authorization SecretKey
expectedArrivalEnabled false String When authType is phone, enable attendance list switch N: Disable Y: Enable

infoFields Field Description

Parameter Required Type Description
name false String When authType is info, optional parameter. Registration field name, max 8 characters
type false String When authType is info, required parameter. Registration type
name: Name
text: Text
mobile: Phone number
number: Number
option: Dropdown option
options false String When authType is info, optional parameter. Dropdown option values, separated by commas. Max 8 options; each option max 8 characters
placeholder false String When authType is info, optional parameter. Input prompt text, max 8 characters
sms false String When authType is info, optional parameter. SMS verification switch, Y: Enable, N: Disable

Example

http://api.polyv.net/live/v3/channel/basic/update?appId=frlr1zazn3&sign=2FC2F272EBEEC40CC1833A127BF4F53F&channelId=2191569&timestamp=1621840356767

Request body JSON parameters:

{
    "basicSetting": {
        "name": "测试",
        "channelPasswd": "10086",
        "publisher": "主持人名称",
        "startTime": 1557888134000,
        "pageView": 1000,
        "likes": 666,
        "coverImg": "http://my.polyv.net/v_22/assets/dist/images/navbar/logo.png",
        "splashImg": "http://my.polyv.net/v_22/assets/dist/images/navbar/logo.png",
        "splashEnabled": "Y",
        "desc": "这是直播介绍,可以是html代码",
        "consultingMenuEnabled": "N",
        "maxViewerRestrict": "Y",
        "maxViewer": 100,
        "categoryId": 345134,
        "closeDanmu": "N",
        "showDanmuInfoEnabled": "N",
        "labelData":["zpmz3640wkxpj267"]
    },
    "authSettings": [{
        "rank": 1,
        "enabled": "Y",
        "authType": "external",
        "externalKey": "L0EjokKI4O",
        "externalUri": "http://demo.ipolyv.cn/chenwb/live-validate.php",
        "extTrialWatchEnabled": "Y",
        "extTrialWatchTime": 5,
        "extTrialWatchEndTime": "2026-08-31 12:00",
        "extTrialRedirectUrl": "https://www.baidu.com"
    }]
}

Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure See global error description
status String Response status text
message String Response description, provides error details when code is 400 or 500
data String Returns an empty string on both success and failure

Java Request Example

For quick integration of basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. The HttpUtil.java and LiveSignUtil.java in the test cases 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(ChannelOperateTest.class);
/**
 * 修改频道信息
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void testUpdateChannelDetailSetting() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际
    String appId = super.appId;
    String appSecret = super.appSecret;
    String userId = super.userId;
    String timestamp = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "http://api.polyv.net/live/v3/channel/basic/update";
    String channelId = "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));
    url = HttpUtil.appendUrl(url,requestMap);
    String password=getRandomString(6);
    String json="{\"basicSetting\":{\"name\":\"测试\",\"channelPasswd\":\"%s\",\"publisher\":\"主持人名称\",\"startTime\":1557888134000,\"pageView\":1000,\"likes\":666,\"coverImg\":\"http://my.polyv.net/v_22/assets/dist/images/navbar/logo.png\",\"splashImg\":\"http://my.polyv.net/v_22/assets/dist/images/navbar/logo.png\",\"splashEnabled\":\"Y\",\"desc\":\"这是直播介绍,可以是html代码\",\"consultingMenuEnabled\":\"N\",\"maxViewerRestrict\":\"Y\",\"maxViewer\":100,\"categoryId\":345134,\"closeDanmu\":\"N\",\"showDanmuInfoEnabled\":\"N\"},\"authSettings\":[{\"rank\":1,\"enabled\":\"Y\",\"authType\":\"external\",\"externalKey\":\"L0EjokKI4O\",\"externalUri\":\"http://demo.ipolyv.cn/chenwb/live-validate.php\",\"extTrialWatchEnabled\":\"Y\",\"extTrialWatchTime\":5,\"extTrialWatchEndTime\":\"2026-08-31 12:00\",\"extTrialRedirectUrl\":\"https://www.baidu.com\"}]}";
    json=String.format(json,password);
    String response = HttpUtil.postJsonBody(url, json,null);
    log.info("测试修改频道信息,返回值:{}", response);
    //do somethings
    
}

Response Example

For system-wide global error descriptions, see Global Error Description

Success Example

{
    "code":200,
    "status":"success",
    "message":"",
    "data":""
}

Error Example

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