Discussions

Ask a Question

How to upload image, video or audio using heygen apis to get image_asset_id etc.

How to upload image, video or audio using heygen apis to get image_asset_id, video_asset_id and audio_asset_id respectively and also their urls.

Video length check

Is there an API I can call to with my script for a video to check how long the video is going to be before I submit a call to the API to make the video?

Realtime avatar session limit to one session even when using Business plan API key

Is this because real time avatars are still in preview or what can be done to get more sessions? {"code":10007,"message":"reach user session limit"}

"Voice is expired" at line 1 error message

Hi, Trying to use HeyGen to create a new video based on a finetuned avatar I created (I have a creator subscription and paid for the finetuned avatar) but get an error message when I try to create a video from it: "Voice is expired" at line 1 Any idea of why I get such message? Thanks, G.

Inquiry About Voice Generation API

I have reviewed the API documentation and would like to inquire about the availability of a voice generation API. If such an API does not currently exist, is it possible to develop one separately? This would enable us to create a broader range of related applications.

Create new session is not working

I've just create account and received my api key. And I tried to create new session using /v1/realtime.new api but the response is 401 error. How can I resolve this? Please teach me about solution.

Why does my generated video still have a watermark even though I set "test": false in the request parameters?

Why does my generated video still have a watermark even though I set "test": false in the request parameters? below is my payload { "template_id": "7b05f7b3c36d4b42b1aaa280a0fd00ca", "title": "测试替换", "variables": [ { "properties": { "id":"d4fbedd609464ba68c1dd670a05afa8b", "audio":"https://resource.heygen.com/audio/87ff547dc1d04b2fa246b3af0ea84c08/transcode.mp3" }, "name": "photar_0" } ], "test": false } below is response body { "code": 100, "data": { "video_id": "5b697d1da0e1484d9e7a41816cf65f08" }, "message": "Success" }

How to get uploaded assets link for generate from template

Hi, i am trying to replace my audio source and avatar from a template, but it seems like it doesn't accept assets_id i get from <https://upload.heygen.com/v1/asset>, i still can't find any method to get url from an uploaded assets, Does it mean that i need to upload my asset to Azure or AWS to get an URL provide to Heygen? Is there anyway i can replace an audio using assets_id? { "template_id": "86ec37a4b134461b8bd0cc4abf949d0d", "title": "测试替换", "variables": [ { "properties": { "id":"2249f44b97fc412ba000eee7b0c6b983", "audio":"8ebe0a867c1346b88a7a156895303062" }, "name": "photar_0" } ], "test": true }

✅✅✅ Help to generating the first version 2 video

``` <?php $apiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=='; $client = new \GuzzleHttp\Client(); $response = $client->request('GET', 'https://api.heygen.com/v1/video_status.get', [ 'headers' => [ 'accept' => 'application/json', 'x-api-key' => $apiKey, ], ]); echo $response->getBody(); $heygen = SpaEntity::name('AI VIDEO Hengen.com') ->get(); foreach ($heygen as $spa) { print("\n"); print($spa->URL); print("\n"); } $templateId = '9843b64e0acb90ccb26fd358ae86b638'; // my face and voice $url = 'https://api.heygen.com/v2/template/' . $templateId; $headers = [ 'Accept: application/json', 'x-api-key: '.$apiKey ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); if ($response === false) { echo 'Curl error: ' . curl_error($ch); } curl_close($ch); print("\n Getting the overview \n"); echo $response; print("\n"); $data = [ "test" => true, "caption" => true, "title" => "new video ", "variables" => [ "company" => [ "name" => "company", "type" => "text", "properties" => [ "content" => "Ole Oldhøj cleaning service" ] ], "FirstName" => [ "name" => "company", "type" => "text", "properties" => [ "content" => "Ole" ] ] ] ]; $ch = curl_init('https://api.heygen.com/v2/template/' . $templateId . '/generate'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'X-Api-Key: ' . $apiKey, 'Content-Type: application/json' ]); $response = curl_exec($ch); curl_close($ch); print("\n Getting the VIDEO\n"); echo $response ; $responseObj = json_decode($response); // Access the video_id property $videoId = $responseObj->data->video_id; $VIDEOURL = "https://app.heygen.com/videos/" . $videoId; print("\n video url \n"); print($VIDEOURL); print("\n video url \n"); ```

Why does this payload work and this doesn't?

Hi, I'm calling the endpoint: <https://api.heygen.com/v1/video.generate> And here are three payloads: - A: Doesn't work - Text is 1195 caracter - B: Doesn't work - Text is 1196 caracter (one o at the end) - C: Works - Text is 1197 caracter (two o at the end) The ones not working return: Call API: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>400 Bad Request</title> <h1>Bad Request</h1> <p>The browser (or proxy) sent a request that this server could not understand.</p> PAYLOAD A: { "template_id": "4656a89cf6444ab2a93216d1116f2508", "title": "property investment, residential property portfolio, comprehensive due diligence", "variables": [ { "properties": { "id": "8f216b3f242d4f11b4474a98e8f02fae", "voice_id": "a3c629a7986e4f14a197101e78b36abf", "text": "Hi my name is jamie from siteline properties At siteline we use our .. proprietary technology, to help passionate investors like yourself easily build, manage and scale residential property portfolios. We take care of everything – from sourcing the properties, to letting them! This means you can divert your attention elsewhere whilst we do all the work! How does that sound? Here's how it works... Tell us your budget .. preferred locations .. and yield expectations. Using our innovative technology, we’ll instantly source a fully vetted list of profitable investment opportunities that match your search criteria. We’ll package this up into an.. easy-to-understand document ready for you to approve. All properties go through our own comprehensive due diligence process. Our team of experts will collate and share all of the financial break-down, comparable properties in the market, local area information, refurbishment requirements (if any) and estate agent valuations for sales and lettings. We’ll take care of the entire process from sourcing the deals through to letting them. From sourcing and due diligence, to full deal management and beyond – we’ll take care of everything." }, "name": "avatar_0" } ], "test": false, "caption_open": true } PAYLOAD B: { "template_id": "4656a89cf6444ab2a93216d1116f2508", "title": "property investment, residential property portfolio, comprehensive due diligence", "variables": [ { "properties": { "id": "8f216b3f242d4f11b4474a98e8f02fae", "voice_id": "a3c629a7986e4f14a197101e78b36abf", "text": "Hi my name is jamie from siteline properties At siteline we use our .. proprietary technology, to help passionate investors like yourself easily build, manage and scale residential property portfolios. We take care of everything – from sourcing the properties, to letting them! This means you can divert your attention elsewhere whilst we do all the work! How does that sound? Here's how it works... Tell us your budget .. preferred locations .. and yield expectations. Using our innovative technology, we’ll instantly source a fully vetted list of profitable investment opportunities that match your search criteria. We’ll package this up into an.. easy-to-understand document ready for you to approve. All properties go through our own comprehensive due diligence process. Our team of experts will collate and share all of the financial break-down, comparable properties in the market, local area information, refurbishment requirements (if any) and estate agent valuations for sales and lettings. We’ll take care of the entire process from sourcing the deals through to letting them. From sourcing and due diligence, to full deal management and beyond – we’ll take care of everything.o" }, "name": "avatar_0" } ], "test": false, "caption_open": true } PAYLOAD C: { "template_id": "4656a89cf6444ab2a93216d1116f2508", "title": "property investment, residential property portfolio, comprehensive due diligence", "variables": [ { "properties": { "id": "8f216b3f242d4f11b4474a98e8f02fae", "voice_id": "a3c629a7986e4f14a197101e78b36abf", "text": "Hi my name is jamie from siteline properties At siteline we use our .. proprietary technology, to help passionate investors like yourself easily build, manage and scale residential property portfolios. We take care of everything – from sourcing the properties, to letting them! This means you can divert your attention elsewhere whilst we do all the work! How does that sound? Here's how it works... Tell us your budget .. preferred locations .. and yield expectations. Using our innovative technology, we’ll instantly source a fully vetted list of profitable investment opportunities that match your search criteria. We’ll package this up into an.. easy-to-understand document ready for you to approve. All properties go through our own comprehensive due diligence process. Our team of experts will collate and share all of the financial break-down, comparable properties in the market, local area information, refurbishment requirements (if any) and estate agent valuations for sales and lettings. We’ll take care of the entire process from sourcing the deals through to letting them. From sourcing and due diligence, to full deal management and beyond – we’ll take care of everything.oo" }, "name": "avatar_0" } ], "test": false, "caption_open": true }