Discussions

Ask a Question
Back to All

Heygen V2 streaming.task api giving error 400

I am earlier using v1 APIs, everything is working fine then. But I just migrated to v2 API, and I am facing an issue with streaming.task api. Every time it's throwing error 400.
My API call steps:

  1. created a new session token with streaming.create_token API with heygen API key
  2. Created a new session using that session token with this api streaming.new and these parameters {
    "quality": "medium",
    "voice": {
    "rate": 1
    },
    "video_encoding": "H264",
    "version": "v2",
    "disable_idle_timeout": false
    }
  3. Then I am calling streaming.start api with session_id [from step 2] and session token
  4. Now I am calling streaming.task api with the following parameters and session token
    {
    "session_id": "{{session_id}}",
    "task_type": "repeat",
    "text": "Hello John! How can I assist you today?"
    }

but at this step 4 I am getting
{
"code": 400006,
"message": "Session is not in correct state"
}
Am I doing anything wrong? Or what can I do to fix the issue?