Discussions
Heygen V2 streaming.task api giving error 400
3 months ago by null
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:
- created a new session token with streaming.create_token API with heygen API key
- 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
} - Then I am calling streaming.start api with session_id [from step 2] and session token
- 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?