Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

262
Vistas
Uploading a YouTube Video Using YouTube Data API V3 using Google API Client JavaScript

I visited the Youtube Data v3 API docs to know about how to upload videos using the client library

I got to this page

https://developers.google.com/youtube/v3/docs/videos/insert

but it doesn't seem to explain where to put the video in the request And Also API explorer just gives the code for request, it doesn't let me execute the code for that page

I also read the resource structure page but didn't find where to put the video

https://developers.google.com/youtube/v3/docs/videos#resource

here's my current code

let req = gapi.client.youtube.videos.insert({
  part: 'snippet,status',
  snippet: {
    title: "Test Video",
    description: "Test Description",
    categoryId: 28,
    defaultLanguage: 'en',
    defaultAudioLanguage: 'en'
  },
  status: {
    privacyStatus: "private"
  },
});
console.log(req)
try {
  req.execute(function (response) {
    console.log(response);
  });
} catch (e) {
  console.error(e);
}

Now, where do I put the video in the request? do I have to put that as buffer? I am fetching video from fetch API for uploading via API

and whenever I run the code I get the Error: 400 in the console

code: 400
data: [{…}]
error: {code: 400, data: Array(1), message: 'Request contains an invalid argument.'}
message: "Request contains an invalid argument."

so can you provide a working example of uploading a video using the client library that is fetched from the fetch API and show to structure the request body when using the client library?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda