Discussions

Ask a Question
Back to All

Still having problems with creating a clip via API

Hi,

unfortunately I still can't create a clip using API.

I followed your instructions by setting the rectangle option to 1,0,1,0, but nothing (see example 1), in the end it always responds with url_pending.

EXAMPLE 1

REQUEST 
curl --request POST \
     --url https://api.d-id.com/clips \
     --header 'accept: application/json' \
     ---header 'authorization: Basic *****************************************lzcll0VjVFcjc2VnR6OWYwXw==' \
     --header 'content-type: application/json' \
     --data @- <<EOF
{
  "script": {
    "type": "text",
    "provider": {
      "type": "microsoft",
      "voice_id": "it-IT-ElsaNeural"
    },
    "ssml": "false",
    "input": "Certamente! Innanzitutto, il moto di un punto è descritto dalla sua posizione nel tempo. La velocità di un punto, definita come la variazione di posizione nel tempo, può essere considerata sia come un concetto scalare che come un vettore. Come scalare, la velocità rappresenta semplicemente la grandezza della variazione di posizione nel tempo e si esprime solitamente in unità di lunghezza divise per unità di tempo, ad esempio metri al secondo o chilometri all'ora"
  },
  "config": {
    "result_format": "mp4"
  },
  "presenter_config": {
    "crop": {
      "type": "rectangle",
      "rectangle": {
        "bottom": 1,
        "right": 0,
        "left": 1,
        "top": 0
      }
    }
  },
  "background": {
    "source_url": "https://www.dap-system.it/AI/background-empty-boardroom-glass.jpg"
  },
  "presenter_id": "amy-Aq6OmGZnMt"
}
EOF

RESPONSE
{
  "id": "clp_1bXIAFVLj7qwSE0vqjHlL",
  "created_at": "2024-04-01T20:57:25.785Z",
  "object": "clip",
  "status": "created"
}

So I also tried without the rectangle option (see example 2).

REQUEST
curl --request POST \
     --url https://api.d-id.com/clips \
     --header 'accept: application/json' \
     --header 'authorization: Basic *****************************************lzcll0VjVFcjc2VnR6OWYwXw==' \
     --header 'content-type: application/json' \
     --data @- <<EOF
{
  "script": {
    "type": "text",
    "provider": {
      "type": "microsoft",
      "voice_id": "it-IT-ElsaNeural"
    },
    "ssml": "false",
    "input": "Certamente! Innanzitutto, il moto di un punto è descritto dalla sua posizione nel tempo. La velocità di un punto, definita come la variazione di posizione nel tempo, può essere considerata sia come un concetto scalare che come un vettore. Come scalare, la velocità rappresenta semplicemente la grandezza della variazione di posizione nel tempo e si esprime solitamente in unità di lunghezza divise per unità di tempo, ad esempio metri al secondo o chilometri all'ora"
  },
  "config": {
    "result_format": "mp4"
  },
  "presenter_config": {
    "crop": {
      "type": "rectangle",
      "rectangle": {
        "bottom": 1,
        "right": 0,
        "left": 1,
        "top": 0
      }
    }
  },
  "background": {
    "source_url": "https://www.dap-system.it/AI/background-empty-boardroom-glass.jpg"
  },
  "presenter_id": "amy-Aq6OmGZnMt"
}
EOF

RESPONSE
{
  "id": "clp_Ro9fGsO5EjAMzpml4d888",
  "created_at": "2024-04-02T06:40:08.498Z",
  "object": "clip",
  "status": "created"
}

I expect more support from you and more complete functionality.

Thanks
Robert