Setting Up Webhooks

DynTube allows you to set up webhooks to receive notifications for specific events such as videoPublished, streamStarted, and streamStopped. This documentation will guide you through the process of configuring webhooks for your DynTube account.

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

  1. Log in to your DynTube account.

  2. Navigate to the Account Settings page: https://app.dyntube.com/#/account/settings.

  3. Find the "Webhooks" section and click it

  4. Set the event type e.g "videoPublished."

  5. Provide the webhook URL where you want to receive notifications for videoPublished events.

  6. Webhook configuration will be automatically saved.

Receiving Webhook Data

When the specified events occur, DynTube will send POST requests to the webhook URLs you've configured. Your server should be prepared to handle these incoming requests and process the data accordingly.

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": {
      // Other options
    },
    "Tags": [
      // Tags
    ],
    "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 automate various processes and stay updated on important events within your DynTube account.

Last updated