Videos
Setting Up Webhooks
Use webhooks to receive notifications for events such as videoPublished, streamStarted, and streamStopped. Configure webhook URLs in your DynTube account settings.
Prerequisites
Before you can set up webhooks on the DynTube dashboard, make sure you have the necessary access and permissions within your DynTube account.
Setting Up Webhooks
To configure webhooks for specific events, follow the steps below:
Configuring Published Events
- Log in to your DynTube account.
- Navigate to the Global Settings page: /settings/global?tab=webhooks.
- Open the "Webhooks" section.
- Set the event type, such as videoPublished.
- Provide the webhook URL where you want to receive notifications for videoPublished events.
- Select Save webhooks to store the endpoint and event selection.
Receiving Webhook Data
When a configured event occurs, DynTube sends a POST request to your webhook URL. Your server should validate and process the request, then respond with a successful HTTP status code.
Sample Webhook Data
Here are examples of the data you can expect to receive for each event:
Video Published Event
{
"event": "videoPublished",
"video": {
"Id": "YOUR_VIDEO_ID",
"Duration": "00:00:02.2200000",
"ProjectId": "YOUR_PROJECT_ID",
"AccountKey": "YOUR_ACCOUNT_KEY",
"Region": "aus-s",
"Image": {
"xsUrl": "",
"smUrl": "",
"mdUrl": "",
"lgUrl": ""
},
"Captions": [],
"Key": "YOUR_VIDEO_KEY",
"ChannelKey": "YOUR_CHANNEL_KEY",
"PrivateLink": "YOUR_PRIVATE_LINK",
"IframeLink": "YOUR_IFRAME_LINK",
"HLSLink": "YOUR_HLS_LINK",
"PlanType": 1,
"Mp4Url": "",
"Mp4Urls": [],
"Formats": {
"Hls": true,
"Mp4": false,
"Options": {
"SecureMp4": true
}
},
"HLSUrl": "YOUR_HLS_URL",
"HLSUrlWeb": "YOUR_HLS_URL_WEB",
"Title": "YOUR_VIDEO_TITLE",
"Description": "YOUR_VIDEO_DESCRIPTION",
"Options": {},
"Tags": [
"example-tag"
],
"Version": 1,
"Status": 3,
"Created": "2023-11-02T09:41:42.3963223+00:00"
}
}Stream Started Event
{
"streamKey": "YOUR_STREAM_KEY",
"event": "streamStarted",
"date": "2023-11-02T09:41:35.738Z"
}Stream Stopped Event
{
"streamKey": "YOUR_STREAM_KEY",
"event": "streamStopped",
"date": "2023-11-02T09:41:42.341Z"
}You can use the received data to update your database, notify users, start downstream jobs, or trigger publishing workflows in your own system.
Related Pages
- Get video status if you prefer polling for processing state.
- Video upload via file and Video upload via URL for upload workflows that can trigger videoPublished.
- Get live streaming recording when stream events are used with recorded videos.
Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.