Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

261
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda