Feed Hooks
Activity Feed for Change of Publishing State During Streaming
The feeds type of webhook allows you to receive an activity feed for platform events such as when a stream has started or stopped publishing.
Setting up Webhooks
Review the Webhooks guide for additional details on creating and receiving webhooks.
Event
The event
will be one of the following values:
- started is sent when a broadcast has been started
- ended is sent when a broadcast has been terminated either by the publisher or due to timeout
Each individual stream will send started and ended events.
Data
The data
payload will contain the following details:
- feedId: unique identifier for the feed
- accountId: the publish token account id
- name: the publish token stream name
- streamId: the publish token id
- started: epoch time when the stream was started
- active: boolean flag indicating if the feed is still active
Optional:
- ended: epoch time when the publishing feed was ended (only included when the stream has ended)
Examples
Feed started
Event callback for when a publishing token begins broadcasting.
{
"type": "feeds",
"event": "started",
"timestamp": 1638463486489,
"data": {
"feedId": "369e4a86-f937-4254-bd9f-99dc484d2bd6",
"accountId": "ZG6NWV",
"name": "sample_stream",
"streamId": "ZG6NWV/sample_stream",
"started": 1638463486359,
"active": true
}
}
Feed ended
Event callback for when a publishing token stops broadcasting.
{
"type": "feeds",
"event": "ended",
"timestamp": 1638463501075,
"data": {
"feedId": "369e4a86-f937-4254-bd9f-99dc484d2bd6",
"accountId": "ZG6NWV",
"name": "sample_stream",
"streamId": "ZG6NWV/sample_stream",
"active": false,
"ended": 1638463500963
}
}
Here is an example of the webhook body:
{
"type": "feeds",
"event": "ended",
"timestamp": 1638463501075,
"data": {
"feedId": "369e4a86-f937-4254-bd9f-99dc484d2bd6",
"accountId": "ZG6NWV",
"name": "sample_stream",
"streamId": "ZG6NWV/sample_stream",
"active": false,
"ended": 1638463500963
}
}
Updated about 1 year ago