Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

319
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!