我正在尝试编辑我上传的视频的元数据,并且我在vimeo服务器的响应中收到错误状态400。 I'm using ClicknTap api for java
。
从我的角度来看,参数都是正确的,代码附在下面。
Vimeo vimeo = new Vimeo("c8a84c2f936c934a4735bc22bdcd5fa0");
String name = "Demo1";
String desc = "Description here";
String license = "";
String privacyView = "disable"; // see Vimeo API Documentation
String privacyEmbed = "whitelist";
boolean reviewLink = false;
VimeoResponse respon=vimeo.updateVideoMetadata(videoEndPoint,name,desc,license,privacyView, privacyEmbed, reviewLink);
System.out.println(respon);
输出如下所示: HTTP状态代码: 400
Json:
{
"developer_message": "The parameters passed to this API endpoint did not pass Vimeo's validation. Please check the invalid_parameters list for more information",
"link": null,
"error_code": 2204,
"error": "You have provided an invalid parameter. Please contact developer of this application.",
"invalid_parameters": [{
"field": "privacy.view",
"developer_message": "The parameters passed to this API endpoint did not pass Vimeo's validation. Please check the invalid_parameters list for more information",
"error_code": 2204,
"error": "You have provided an invalid parameter. Please contact developer of this application."
}]
}
答案 0 :(得分:0)
我发现了我的错误。我将privacyView和privacyEmbed值分别更改为 nobody 和 private ,代码正常运行。干净的代码如下。
String name = "Demo1";
String desc = "Description here";
String license = null;
String privacyView = "nobody";
String privacyEmbed = "private";
boolean reviewLink = false;
VimeoResponse respon = vimeo.updateVideoMetadata(videoEndPoint,
name, desc, license, privacyView, privacyEmbed, reviewLink);
希望这对将来有所帮助。