【发布时间】:2021-07-02 14:42:00
【问题描述】:
我正在使用 node.js SDK 来访问 Vimeo API。我正在尝试批量编辑我的专辑(展示)描述符和名称。我已经创建了我的 Vimeo API 应用程序并启用了“编辑”访问权限。可悲的是,当我运行代码时,它返回一个错误,告诉我我的访问令牌没有“编辑”\ 范围。下面是我用来发送请求的代码 sn-p:
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
}
})
}
对我为什么会收到错误有任何想法吗?以下是确切的消息: 服务器报告:错误:{“错误”:“您的访问令牌没有“编辑”范围”}
【问题讨论】: