修改暖场设置开关
接口描述
1、通过频道号,修改暖场开关
2、接口支持https协议接口URL
http://api.polyv.net/live/v3/channel/set-warmup-enabled请求方式
POST接口约束
请求参数描述
参数名
必选
类型
说明
示例
响应参数描述
参数名
类型
说明
Java请求示例
响应示例
Last updated
1、通过频道号,修改暖场开关
2、接口支持https协议http://api.polyv.net/live/v3/channel/set-warmup-enabledPOSTLast updated
http://api.polyv.net/live/v3/channel/set-warmup-enabledappId=frlr1zazn3&warmUpEnabled=Y&sign=39959D3A4001039B5B1F6BA1DC509D98&channelId=2202970×tamp=1621842366226private static final Logger log = LoggerFactory.getLogger(ChannelWarmUpTest.class);
/**
* 修改暖场设置开关
* @throws IOException
*/
@Test
public void testUpdateWarmUpSwitch() 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/set-warmup-enabled";
String channelId = "2202970";
String warmUpEnabled = "Y";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId",channelId);
requestMap.put("warmUpEnabled",warmUpEnabled);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.postFormBody(url, requestMap);
log.info("测试修改暖场设置开关接口返回值:{}",response);
}
{
"code": 200,
"status": "success",
"message": "",
"data": "success"
}{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}