Modify Polling Monitor Account Information
Updated: 2022-09-02 18:08:07
API Description
1、修改轮询监控账号信息
2、(channelId, timestamp, appId)参与sign签名,并和sign一起通过url传递,请求体参数不参与签名,通过post请求体传递【请设置请求头contentType:application/json】
3、接口支持https协议
API URL
https://api.polyv.net/live/v4/seminar/monitor/update
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See 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 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 | true | Integer | Channel ID |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| id | true | Integer | Monitor polling account ID |
| nickname | false | String | Monitor nickname, supports 1-16 characters (leave empty to keep unchanged) |
| password | false | String | Password, supports 6-16 characters (leave empty to keep unchanged) |
Example
https://api.polyv.net/live/v4/seminar/monitor/update?appId=fyirmfdak4×tamp=1657786379352&sign=CEA301164F9BA5076F156C1EB60F22F8&channelId=2191532
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine basic response status |
| status | String | Response result, determined by business logic. Returns success on success, error on failure |
| success | Boolean | Whether the request was successful |
| requestId | String | Request ID, a unique UUID generated for each request. Only for troubleshooting and debugging, should not be tied to business logic |
| error | Object | Error information when status code is not 200 See Error Field Description |
| data | Object | Failure reason, returned on failure. Empty on success See Data Field Description |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to identify the specific error reason |
| desc | String | Error description, corresponding to error.code |
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 project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
It is strongly recommended to use the Live Java SDK to implement API functionality. 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(UpdateAccountPost.class);
/**
* 查询分组记录
* @throws IOException
*/
@Test
public void testUpdateAccountPost() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId=super.appId;
String appSecret=super.appSecret;
String userId = super.userId;
String timestamp=String.valueOf(System.currentTimeMillis());
//业务参数
String url = "api.polyv.net/live/v4/seminar/monitor/update";
String channelId = "2191532";
String body = "{\n" +
" \"enable\":\"N\"\n" +
"}";
//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 response = HttpUtil.postJsonBody(url, body, null);
log.info("测试修改轮询监控账号信息接口返回值:{}",response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "faeae397448d4c5f988b278256cbc487.60.16591497134900021",
"data": null,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"error": {
"code": 10003,
"desc": "时间戳过期"
},
"success": false
}
{
"code": 403,
"status": "error",
"error": {
"code": 10002,
"desc": "签名错误"
},
"success": false
}
{
"code": 400,
"status": "error",
"requestId": "faeae397448d4c5f988b278256cbc487.66.16591497085220019",
"error": {
"code": 1081,
"desc": "没有监控轮询权限"
},
"data": null,
"success": false
}
{
"code": 400,
"status": "error",
"requestId": "b7463368632042daaf4d700631dda9e1.70.16593213159150141",
"error": {
"code": 50101,
"desc": "监控轮询账号不存在"
},
"data": null,
"success": false
}
{
"code": 400,
"status": "error",
"requestId": "b7463368632042daaf4d700631dda9e1.69.16593219092970191",
"error": {
"code": 10001,
"desc": "密码长度为6~16"
},
"data": null,
"success": false
}
{
"code": 400,
"status": "error",
"requestId": "b7463368632042daaf4d700631dda9e1.66.16593219248760193",
"error": {
"code": 10001,
"desc": "昵称长度为1~16"
},
"data": null,
"success": false
}
