【发布时间】:2020-08-15 16:47:09
【问题描述】:
我希望使用 Vimeo Api 和 Google Apps 脚本重命名我的视频。我成功地让 API 将视频移动到文件夹中(使用与下面几乎相同的语法),但我一生都无法重命名。非常令人沮丧。
Here 是参考,下面是我的代码 - 它只是返回视频信息,就好像我没有尝试更改任何内容一样,即使我显然使用的是“PATCH”调用,而不是“GET” . 我打算把'name'参数放在哪里??
function renameVideo(){
var newName = 'thisismynewname';
var url = 'https://api.vimeo.com/videos/_________?name=' + newName;
var options = {
'method': 'PATCH',
'muteHttpExceptions': true,
'contentType': 'application/json',
'headers': {
'Accept':'application/vnd.vimeo.*+json;version=3.4',
'Authorization': "Bearer " + token,
},
//Note that I've also tried 'name' : 'thisismynewname' here too
};
var response = UrlFetchApp.fetch(url, options);
Logger.log(JSON.parse(response).name); //it just returns the *current* name not the new one, and doesn't change it
}
【问题讨论】:
标签: javascript api google-apps-script vimeo vimeo-api