Template To Video
POST https://api.newportai.com/api/async/template2video
User will receive a video generated based on the uploaded image and the selected template style. For example, dancing video, hugging video, kissing video. All templates can be obtained by Get Video Template.
- By calling Get Video Template API to obtain all available template styles, select the template you need and obtain the template id.
- Call the template generated video interface with template id and user image as parameters.
- Use the Polling API to get results.
Request Headers
- Content-TypestringRequiredEnumapplication/json
- AuthorizationstringRequiredBearer authentication format, for example: Bearer
Request Body
- templateIdstringRequiredtemplate id from [Get Video Template](https://api.newportai.com/docs/get-video-template).
- imgUrlstringRequiredimage url that supports public access.
Response
- codeinteger0 success, or error code.
- messagestring"success", or error msg.
- dataobjecttaskIdstringUse the taskId to request the Polling API to retrieve the generated outputs.
Example
Request:
zsh
curl -X POST 'https://api.newportai.com/api/async/template2video' \
-H 'Authorization: Bearer {{key}}' \
-H 'Content-Type: application/json' \
-d '{
"templateId": "6752c394d3333900087a538f",
"imgUrl": "https://dreamface-resource-new.s3.amazonaws.com/server/aigc/file-transfer/2024-12-06/c866fe1b8c034fcb9bfa782d97bbac1f.jpg"
}'
Response:
json
{
"code": 0,
"message": "success",
"data": {
"taskId": "89b7136b8ff84cc38d22a3cea043a9df"
}
}
Next Step:
Use Polling API to get the result.