Update Chat Review Toggle
Updated: 2024-04-22 19:18:32
API Description
1、更新聊天审核开关
2、接口支持https协议
API URL
https://api.polyv.net/live/v3/channel/chat/update-censor-enabled
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure security. API calls have frequency limits. See details
Request Parameters
| 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 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 signature generation rules |
| channelId | yes | int | Channel ID |
| enabled | no | string | Toggle Y/N. If not provided, the current toggle value will be switched on/off |
Example
http://api.polyv.net/live/v3/channel/chat/update-censor-enabled?appId=frlr1zazn3&sign=FD701BFA3DCE2C7DCC362A904DBF48B0×tamp=1636536555144&channelId=3335806&enabled=Y
Response Parameters
| Name | Type | Description |
|---|---|---|
| code | string | Response code: 200 for success, 400 for failure, 403 for signature error, 500 for server error |
| status | string | success for success, error for failure |
| message | string | Error message when an error occurs |
| data | boolean | Returns the current chat review toggle status after setting: true for enabled, false for disabled |
Java Request Example
For quick integration of basic code, download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code 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 packaging and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
private static final Logger log = LoggerFactory.getLogger(getClass());
@Test
public void testUpdateCensorEnabled() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v3/channel/chat/update-censor-enabled";
String channelId = "3335806";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("enabled", "Y");
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postFormBody(url, null);
log.info("测试更新聊天审核开关:{}", response);
//do somethings
}
Response Example
For global error descriptions, see Global Error Descriptions
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": false
}
Error Example
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": null
}
