Discussions

Ask a Question
Back to All

https://api.heygen.com/v2/video/generate

I'm trying to create a video using this api and I want to add a background image. I have added
images from url extension jpg, png
tried to upload it to google drive and made it publically accessible

But whenever I tried to generate the video

the background image is not setting

Im using api service

api key is not of enterprise type

this is my request payload


let video_data = {  
  video_inputs: [  
    {  
      character: {  
        type: "avatar",  
        avatar_id: obj.avatar_id,  
        avatar_style: "normal",  
      },  
      voice: {  
        type: "text",  
        input_text: obj?.description,  
        ,  
        voice_id: obj.voice_id,  
      },  
    },  
  ],  
  title: obj?.product_title,  
  test: false,  
  caption: obj.caption,  
  dimension: {  
    width: 1280,  
    height: 720,  
  },  
};  
if (!!obj.background_image) {  
  video_data["background"] = {  
    type: "image",  
    url: obj.background_image  
  };  
  video_data["aspect_ratio"] = "16:9";  
}

const config = {
  method: "post",
  maxBodyLength: Infinity,
  url: "https://api.heygen.com/v2/video/generate",
  headers: {
    "X-Api-Key": 'my-key-test-type',
    "Content-Type": "application/json",
  },
  data: JSON.stringify(video_data),
};

Now, can you tell me what is wrong with this api service? I have tried both jpg and png

I have two namespace accounts. The main is free and second is team type in which I have credited credits.