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

233
Views
Sharing Video to TikTok on the Web always return Bad Request

I followed the documentation here https://developers.tiktok.com/doc/web-video-kit-with-web to Log in using the Login Kit and then I successfully got the access_token and open_id for an account.

Now I uploaded a video following the instructions in the documentations as follows from an ExpressJS Server:

const FormData = require('form-data');
const got = require('got');
const axios = require('axios');

//Video Upload Function
async function uploadVideoToTikTok(){
let tikTokAccessToken = //Retrieved from database;
let openId = //Retrieved from database;
let shareUrl = `https://open-api.tiktok.com/share/video/upload/?open_id=${openId}&access_token=${tikTokAccessToken}`;
                
let video = got.stream(mediaUrl); //Media Url is similar to https://firebasestorage.com/adadadadadadad.mp4
let tikTokShareform = new FormData();
tikTokShareform.append("video", video);
try {
     let { data } = await axios.post(shareUrl, tikTokShareform);
     console.log(`TikTok Upload Result=${JSON.stringify(data, null, 2)}`);
   } catch (e) {
    console.log(`TikTok Video Upload Error`);
    console.log(e);
   }
}

But the response I keep getting back is

'Bad Request'

No further info was provided for me to know the reason for the bad request.

Also I noticed the documentation didn't provide any info on how to provide description or title for the video.

Any ideas on how I can resolve this will be truly appreciated.

Thank you

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Probably the problem was due to missing Content-Type header in your HTTP POST request, you should try something like:

let { data } = await axios.post(
  shareUrl,
  {
    headers: {
      "Content-Type": "multipart/form-data",
    },
  },
  tikTokShareform,
);

Or, even better:

let { data } = await axios.post(
  shareUrl,
  {
    headers: tikTokShareform.getHeaders(),
  },
  tikTokShareform,
);
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!