I'm new to nodejs.
I want to get my video list using vimeo api.(https://developer.vimeo.com/api/guides/start)
In the following code, I want to return the body or error of the callback function rather than print it.
function get_Vimeo_Data() {
let Vimeo = require('vimeo').Vimeo;
let client = new Vimeo("api_key", "key");
client.request({
method: 'GET',
path: '/me/videos'
}, function (error, body, status_code, headers) {
if (error) {
console.log(error)
}
console.log(body)
});
}
I tried to use promises by referring to various codes, but all failed.
It seems that vimeo api must use callback.