Feeds hooks

Receive notifications about when a stream is being published

The feed hooks will allow you to receive events when a stream has been published or stopped publishing.

There are to different events seng by the feeds hooks:

  • started which is sent when a publishing feed has been started
  • ended which is sent when a publishing feed has been terminated either by the publisher or Milicast server.

Millicast will send hooks for each individual feed, not stream wide. That is, if you start publishing in one stream and then without stopping it you start streaming to the same stream in another encoder/browser, you will get a new started event, and a stopped event on the previous one.

Webhook Payload data

The payload of the events will contain the following information

  • feedId: unique identifier for the publishing feed.
  • accountId: Millicast account id.
  • name: Millicast stream name.
  • streamId: Millicast stream id.
  • started: timestamp in seconds when the publishing feed was started.
  • active: boolean flag indicating if the publishing feed is active, true on the started event, false on the ended event.
  • ended: timestamp in seconds when the publishing feed was ended (only available on the ended events).

Feed started webhook

Millicast will trigger this webhook when a publishing feed has been started, the event name is started.

Here is an example of the webhook body:

{ 
  type: "feeds",
  event: "started",
  timestamp: 1638463486489,
  data:{
    feedId: '369e4a86-f937-4254-bd9f-99dc484d2bd6',
    accountId: 'ZG6NWV',
    name: 'testy',
    streamId: 'ZG6NWV/testy',
    started: 1638463486359,
    active: true
    }
}

Feed ended webhook

Millicast will trigger this webhook when a publishing feed has been terminated either by the publisher or the Millicast server, the event name is ended.

Here is an example of the webhook body:

{ 
  type: "feeds",
  event: "ended",
  timestamp: 1638463501075,
  data:{
    feedId: '369e4a86-f937-4254-bd9f-99dc484d2bd6',
    accountId: 'ZG6NWV',
    name: 'testy',
    streamId: 'ZG6NWV/testy',
    active: false,
    ended: 1638463500963
    }
}

Did this page help you?