我正在尝试在 Node.js 中设置一个单用户应用程序,它将使用 vimeo-api ( https://github.com/vimeo/vimeo.js )将视频上传到我的应用程序
我正在遵循指南(https://developer.vimeo.com/api/upload),但它似乎不起作用。
我有以下代码:
var Vimeo = require('vimeo-api').Vimeo;
var lib = new Vimeo(MY_CLIENT_ID, MY_CLIENT_SECRET);
lib.access_token = "<OAUTH_TOKEN>";
我试过了:
lib.request({path: "/me", method: "GET"}, function (error, body, status_code, headers) {console.log(body);})
已收到:
{
uri: '/users/26512824',
name: 'Dipankar',
link: 'https://vimeo.com/user26512824',
...
account: 'basic',
pictures: ... ,
websites: [],
stats: {},
metadata: ... ,
content_filter: [ 'language', 'drugs', 'violence', 'nudity', 'safe', 'unrated' ]
}
当我尝试以下获取上传票时:
lib.request({path: "/me/videos", method: "POST"}, function (error, body, status_code, headers) {console.log(body);})
我得到:
null
此外,我尝试通过 cURL 来验证步骤
curl --data "" -H "Authorization: bearer <OAUTH_TOKEN>" https://api.vimeo.com/me/videos
回应是:
{
"error": "The app is not allowed to perform that action. [Missing permission to upload to owner]."
}
我想我错过了一些东西。我还在应用程序页面中收到以下可能相关的消息: