Modify Channel Subtitle Configuration
Updated: 2025-12-25 16:11:34
API Description
1、修改频道字幕配置信息
2、接口支持https协议
API URL
https://api.polyv.net/live/v4/channel/subtitle/config/update
Request Method
POST
API Constraints
- 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 within 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 through your own server to relay requests to the POLYV server for response data. See details: Signature Generation Rules |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| channelId | true | Integer | Channel ID |
| realTimeSubtitleEnabled | false | String | Real-time subtitle toggle, Y: Enable, N: Disable |
| realTimeSubtitleDisplayEnabled | false | String | Real-time subtitle display toggle (controls viewer side), Y: Enable, N: Disable |
| realTimeSubtitleDisplayNumberLimitEnabled | false | String | Real-time subtitle display count limit toggle, Y: Enable, N: Disable |
| realTimeSubtitleDisplayNumber | false | Integer | Maximum number of real-time subtitles displayed |
| sourceLanguage | false | String | Original subtitle language, Chinese: Chinese; English: English |
| subtitleTranslationEnabled | false | String | Subtitle translation toggle, Y: Enable, N: Disable |
| translationLanguage | false | String | Subtitle translation language, Chinese: Chinese; English: English, etc. |
| translationLanguages | false | Array | Translation language array |
| subtitleCallbackEnabled | false | String | Subtitle callback toggle, Y: Enable, N: Disable |
| subtitleCallbackUrl | false | String | Subtitle callback URL |
Example
https://api.polyv.net/live/v4/channel/subtitle/config/update?appId=frlr1zazn3&sign=4049473DAEBBEFF778DABD1A25E3409B×tamp=1642732753732
Request body JSON parameters:
{
"channelId":100033333,
"realTimeSubtitleEnabled":"Y",
"realTimeSubtitleDisplayNumberLimitEnabled":"Y",
"subtitleTranslationEnabled":"Y",
"sourceLanguage":"English",
"translationLanguage":"Chinese",
"realTimeSubtitleDisplayNumber": 5
}
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 | Object | Empty on failure, subtitle configuration information on success See details: data field description |
Java Request Example
For quick integration of the base 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, both contained 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 testUpdateSubtitleSetting() 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/v4/channel/subtitle/config/update";
String jsonStr = "{\"channelId\":2779045,\"realTimeSubtitleDisplayNumberLimitEnabled\":\"N\"," +
"\"realTimeSubtitleEnabled\":\"N\"," +
"\"subtitleTranslationEnabled\":\"Y\",\"translationLanguage\":\"Chinese\",\"sourceLanguage\":\"English\"}";
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, jsonStr, null);
log.info("测试更新频道字幕配置信息,返回值:{}", response);
//do somethings
}
Response Example
For system global error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "14138a5004b1412fbe109f854fec0b52.59.16538790171742883",
"data": "",
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
