Discussions

Ask a Question
Back to All

Get upload URL

Hi Heygen Team,

I want to create 'Talking photo'/ TPs from API. By following the "use cases: Create a video with your own photo". I can't get the response 200 from "Get upload URL" API. I use node js to fetch the data. But the response is 400(BAD REQUEST). I also test other APIs like 'create video' or others. It works fine.

Is there anything that I'm missing?

const url = 'https://api.heygen.com/v1/upload_url.get';
const contentType = 'image/jpeg'
const headers = {
    'x-api-key': heygenAuthToken,
    'Content-Type': 'application/json'
}
const body = {
    content_type: 'image/jpeg'
};
try {
    const response = await fetch('https://api.heygen.com/v1/upload_url.get', {
        method: 'GET',
        headers,
        body: JSON.stringify(body)
    });
}catch(err){
  console.log(err);
}

Thanks for your help

Br,