Modify Video Information
Updated: 2022-09-02 18:08:07
API Description
1、通过子账号id和视频id,修改视频的信息
2、接口支持https协议
API URL
http://api.polyv.net/v3/video/update-info
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls are subject to rate limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | POLYV VOD sub-account appId. Path: POLYV VOD Console -> Settings -> Account Management |
| timestamp | true | Long | Current time in milliseconds, valid for 3 minutes |
| sign | true | String | Signature, 32-character uppercase MD5 value. See MD5 signature generation rules |
| vid | true | String | Video ID. Path: POLYV VOD Console -> Video List; or obtained from Upload Video |
| title | false | String | Video title |
| describ | false | String | Video description |
| tag | false | String | Video tag information |
| publishUrl | false | String | External link URL |
Example
http://api.polyv.net/v3/video/update-info
Form Parameters:
vid=1b448be32370f4822ac40fd926112a66_1&describ=%E8%A7%86%E9%A2%91%E6%8F%8F%E8%BF%B0&appId=a0Wmol5EwX&sign=519EF60C39FB0FB4012B85018EAE9FFA&tag=%E8%A7%86%E9%A2%91%E6%A0%87%E7%AD%BE%E4%BF%A1%E6%81%AF&title=%E8%A7%86%E9%A2%91%E6%A0%87%E9%A2%98&publishUrl=www.baidu.com×tamp=1617948729943
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code. 200 indicates success, non-200 indicates failure. See global error description |
| status | String | Response status text |
| requestId | String | Business request ID for troubleshooting on client/server side |
| error | Object | Detailed error information on failure. See error field description. Returns empty on success |
| data | Object | Returns empty on both success and failure |
Error Field Description
| Field | Type | Description |
|---|---|---|
| code | Integer | Error code |
| desc | String | Error description. See global error description |
Java Request Example
For quick integration, please download the relevant dependency source code. Click to download source code. Add it to your project after downloading. HttpUtil.java and VodSignUtil.java in the test cases are included in the download file.
It is strongly recommended to use the VOD Java SDK for API integration. The VOD 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(VodSubAccountTest.class);
/**
* 修改视频信息
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testModifySubVideoInfo() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v3/video/update-info";
String vid = "1b448be32370f4822ac40fd926112a66_1";
String title = "视频标题";
String describ = "视频描述";
String tag = "视频标签信息";
String publishUrl = "www.baidu.com";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("vid", vid);
requestMap.put("title", title);
requestMap.put("describ", describ);
requestMap.put("tag", tag);
requestMap.put("publishUrl", publishUrl);
//用md5进行签名,使用子账号的secretKey签名
requestMap.put("sign", VodSignUtil.getSignMd5(requestMap, appSecret));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试修改视频信息,{}", response);
//do somethings
}
Response Example
For system-wide global error descriptions, see Global Error Description
Success Example
{
"requestId": "fb3c68df-2f17-4bed-83c5-f2c4eaf4844f",
"code": 200,
"status": "success",
"error": null,
"data": null
}
Error Example
{
"requestId": "d9eeca6f-2a0a-4329-b1b0-beb8e3764ecd",
"code": 403,
"status": "error",
"error": {
"code": 104,
"desc": "invalid signature"
},
"data": null
}
