Launch the video creation
fetch('https://rollideo.com/create/video', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR SECRET KEY HERE'
},
body: JSON.stringify({
"text_segments": [
{
"api_source_type": "picture",
"picture": "https://i.postimg.cc/3r4RL5YX/ocean1.jpg",
"textforvideo": "This is the first segment of the video.",
"voice_id": "Joanna"
}
/*
,
{
"api_source_type": "picture",
"picture": "https://i.postimg.cc/Znh1FdJD/ocean2.jpg",
"textforvideo": "This is the second segment of the video.",
"voice_id": "Matthew"
}
*/
]
})
}).then(response=>response.json()).then(data=>{ console.log(data); });
Check the status of the video creation, the first fetch() above has returned the task_id fetch('https://rollideo.com/task/video', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR SECRET KEY HERE'
},
body: JSON.stringify({
"task_id": "34uic4cd-6d7b-49e1-aza9-d9fe6748c1eb"
})
}).then(response=>response.json()).then(data=>{ console.log(data); });