-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document passing body
via client.request()
(using query
and headers['Content-Type']
)
#186
Comments
The closest thing I can see is this in the tests: vimeo.js/test/lib/vimeo_test.js Lines 481 to 486 in cb62cb6
But using import { Vimeo } from '@vimeo/vimeo';
const client = new Vimeo(VIMEO_CLIENT_ID, VIMEO_CLIENT_SECRET, VIMEO_ACCESS_TOKEN);
client.request(
{
method: 'POST',
path: `/videos/${vimeoVideoId}/pictures`,
headers: { 'Content-Type': 'application/json' },
query: { active: true },
},
(error, response) => {
if (error) {
console.log('error', error);
}
console.log('response', response);
},
); |
Add a new thumbnail at 0 seconds of a videoIf you uploaded a new video, and want to set a new thumbnail at 0 seconds of the video: import { Vimeo } from '@vimeo/vimeo';
const client = new Vimeo(VIMEO_CLIENT_ID, VIMEO_CLIENT_SECRET, VIMEO_ACCESS_TOKEN);
client.request(
{
method: 'POST',
path: `/videos/${vimeoVideoId}/pictures`,
headers: { 'Content-Type': 'application/json' },
query: {
active: true, // Make this the active thumbnail
time: 0, // Time offset in seconds from start of video
},
},
(error, response) => {
if (error) {
console.log('error', error);
}
console.log('response', response);
},
); |
body
via client.request()
body
via client.request()
(using query
and headers['Content-Type']
)
I renamed this issue to be about documentation, because this approach of passing the body via the This basic use case should probably be documented front and center on the documentation for this library. |
So many hours lost trying to figure this out, thank you, it's a shame that you brought this up over a year ago and it's still not updated on the documentation |
Hi there, thanks for this library!
I'm just trying to pass a "Body" option
active: true
to a new thumbnail, which is mentioned in the API documentation forPOST https://api.vimeo.com/videos/{video_id}/pictures
(see below)The numbered comments in the code block below show all of the *non-working* things I've tried (I tried them one by one, on their own):
I don't see the
body
documented anywhere... is there a way to do this with the client?The text was updated successfully, but these errors were encountered: