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

322
Visualizações
How to Upload Video to Pinterest via API

I am trying to upload a video to Pinterest, so I followed the instructions in their docs here

Here is how I attempted the upload

let headers = {
      'Authorization': `Bearer ${access_token}`
}
let videoUploadIntentEndpoint = `https://api.pinterest.com/v5/media`;
let videoUploadIntentResponse = await axios.post(videoUploadIntentEndpoint,
    {
        "media_type": "video"
    },
    {
        headers: headers
    }
);
let { media_id, upload_parameters, media_type, upload_url } = videoUploadIntentResponse.data;
if (media_id && upload_url) {
    try {
        let vidUploadParams = new URLSearchParams();
        vidUploadParams.append("file", got.stream(mediaUrl));
        let videoUploadResponse = await axios.post(upload_url, vidUploadParams, {
            headers: { ...upload_parameters }
        });
        let vidData = videoUploadResponse.data;
        console.log(`Pinterest Video Successful with Data`);
        console.log(JSON.stringify(vidData, null, 2));
    } catch (vidError) {
        console.log(`Pinterest Video Upload Error`);
        console.log(vidError);
    }
}

And the error I keep getting back is

AccessDeniedNo AWSAccessKey was presented.AFHHW0M2afafafR9N8afafafafafafa+g5y3qsXqKwta0eN6ND03J7UDEjpk4F1/qbFrfec=

How can I resolve this?

Thanks

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The doc isn't super clear, but the upload_parameters must be sent along the file in the body, not in the headers. "Send the media file's contents as the request's file parameter and also include all of the parameters from upload_parameters" (this is confusing because Content-Type still belongs in the headers)

(the AWSAccessKey the error is talking about is the first part of the x-amz-credentials string)

about 4 years ago · Juan Pablo Isaza Relatório
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