Instead of polling the API each time you start a render or create an asset, you can set up a webhook.
Setting it up
If you go to the dashboard, under the settings panel, you can input a public url. We will send all webhook events for your account to this url. It must be an https url.
Event types
Let's look at two different types of event - render and assets .
Render
These events enable you to keep track of all your render requests and process their results.
Queued
If your render pool is full, we will queue up the task and provide you with a position field. This tells you the position in the queue, of your new request:
{
"type": "RENDER_QUEUED",
"payload": {
"id": "b477e483-592a-4bc6-a22b-563ef7f48e25",
"position": 2,
}
}
Progress
Once your request starts processing, we will periodically send you progress events until the request either succeeds or in rare cases fails.
{
"type": "RENDER_PROGRESS",
"payload": {
"id": "b477e483-592a-4bc6-a22b-563ef7f48e25",
"progress": 56,
}
}
Success
Once the render is finished, a success event will be sent, with a url attached, from which you can download the video file:
{
"type": "RENDER_SUCCESS",
"payload": {
"id": "b477e483-592a-4bc6-a22b-563ef7f48e25",
"progress": 100,
"url": "https://cdn.veed.dev/R1vqZ0KfPp5y2z7ddiTyt.mp4"
}
}
Failure
If something goes wrong during the render, a failure event will be sent alongside a message
field, to help you debug the problem. If you have any problems at all, please don't hesitate to contact us!
{
"type": "RENDER_FAILURE",
"payload": {
"id": "b477e483-592a-4bc6-a22b-563ef7f48e25",
"message": "Video file corrupted."
}
}
Assets
An asset emits different events that help you keep track of its state:
Uploaded
Once your file is uploaded, we will send an uploaded event, with the url where your asset is stored:
{
"type": "ASSET_UPLOADED",
"payload": {
"id": "28a510a8-6690-4cdc-b319-e0e02ebf1a2e",
"type": "video",
"url": "https://cdn.veed.dev/380rreVE_9uhiksitOGIW.mp4"
}
}
Transcribed
If you choose to transcribe your asset, we will send a transcribed event when transcription has finished:
{
"type": "ASSET_UPLOADED",
"payload": {
"id": "28a510a8-6690-4cdc-b319-e0e02ebf1a2e",
"type": "video",
"url": "https://cdn.veed.dev/380rreVE_9uhiksitOGIW.mp4",
"trancription": [
{ "value": "Hey, how are you?", "from": "1.54", "to": "3.34" },
{ "value": "This is an example of transcription feature", "from": "3.73", "to": "5.26"},
]
}
}