Discussions

Ask a Question
Back to All

For the /talks API how do I prevent the result URL from downloading the files

Hi,

  1. I am using the /talks API to make the avatar speak the text I'm passing
  2. But the result-url of the talking avatar downloads the file on my local
  3. How can I get the url to just show the video and play it? I need to embed the url in my front-end and have it play from there.
  4. Also I'm getting a CORS error with the following fetch call -

useEffect(() => {
const payLoad = {
"source_url": "https://create-images-results.d-id.com/google-oauth2%7C114817182287125517999/drm_vki6canbpQDlpv4qScCiW/image.png",
"script": {
"type": "text",
"input": "Hello world!"
}
};

fetch('https://api.d-id.com/talks', {
  method: 'POST',
  mode: 'cors',
  headers: {
    'X-API-KEY': 'my-api-key',
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(payLoad)
})
.then(response => response.json())
.then(data => console.log("API response:", data))
.catch(error => console.error("Error calling D-ID API:", error));

}, []);