Generate a Video
/script-to-video
/script-to-video
endpoint: polling and webhooks. This guide will walk you through how to send a request and receive a response using both approaches. By the end of this guide, you will be able to choose the appropriate method and handle responses effectively for your use case.Polling
apiFileId
. You can include this ID as a query parameter in the /get-file
endpoint, which will return the current status of the request, how long it has been running, and other relevant details. Keep in mind that the video export time will typically be around the same length as the video itself. Below is an example of how to implement polling logic. This method allows you to continually monitor the progress of your request without needing to rely on webhooks.
Webhooks
/script-to-video
endpoint. Once the video is generated, the API will send a POST
request to your webhook URL, containing a JSON body with the apiFileId
and apiFileSignedUrl
. This approach eliminates the need to continuously check for updates, making it a more efficient option for longer video exports or when you don’t need immediate feedback. By using webhooks, you can handle the completion of video processing automatically and perform actions as soon as the video is ready.
Modified at 2024-11-01 22:54:33