我使用 node.js SDK 来访问 Vimeo API。我正在尝试批量编辑我的专辑(Showcases)描述符和名称。我已经创建了我的 Vimeo API 应用程序并启用了“编辑”访问权限。遗憾的是,当我运行代码时,它返回一个错误,告诉我我的访问令牌没有“编辑”\ 范围。下面是我用来发送请求的代码片段:
async function setDescriptors(albumPath, newTitle, description) {
const vimeo = await ensureVimeoClient();//Checks the connection before proceeding
console.log("Album path: " + albumPath + "\n" + description);
return await vimeo.request({
method: 'PATCH',
path: albumPath,
params: {
'name': newTitle,
'description': description
}
}, function (error, body, statusCode, headers) {
if (error) {
console.log('There was an error making the request.')
console.log('Server reported: ' + error)
return
}
})
}
对为什么我收到错误有任何想法吗?以下是确切消息: 服务器报告:错误:{"error":"您的访问令牌没有“编辑”范围"}
答案 0 :(得分:0)
在您生成访问令牌 (https://developer.vimeo.com/apps) 的开发者站点上,您需要生成具有“公共”、“私有”和“编辑”范围的经过身份验证的访问令牌。