diff --git a/millicast/webhooks/index.mdx b/millicast/webhooks/index.mdx index ce6af20896dc..4031dfa9b095 100644 --- a/millicast/webhooks/index.mdx +++ b/millicast/webhooks/index.mdx @@ -158,6 +158,14 @@ The [Thumbnail](/millicast/webhooks/thumbnail.mdx) hook does not use this schema The [ViewerConnection](/millicast/webhooks/viewerconnection.md) hook guide explains how to use viewer connection events to automate your workflow. +## Filtered webhooks + +You may wish to send webhooks for different groups of streams to different webhook URLs. For example you may set up different targets for webhooks relating to different environments, customers or regions. + +You can do this by configuring a **filter** on your webhook. A filter is a regular expression. Only events matching the filter will be sent to the webhook. + +For event types 'feeds', 'media', 'thumbnail' and 'viewerConnection' the filter will be applied to the `streamName` data field. For event type 'transcoder' the filter will be applied to the `transcoderName` data field. + ## Learn more Learn more or find examples by exploring the [developer blog](https://optiview.dolby.com/resources/blog/tag/webhooks) and [code samples](https://github.com/orgs/dolbyio-samples/repositories?q=webhooks). diff --git a/millicast/webhooks/thumbnail.mdx b/millicast/webhooks/thumbnail.mdx index 3c1e8430e6e1..c71989df28a9 100644 --- a/millicast/webhooks/thumbnail.mdx +++ b/millicast/webhooks/thumbnail.mdx @@ -65,6 +65,7 @@ The following HTTP headers are on the request to identify stream details: - **X-Millicast-Timestamp**: timestamp of the generated thumbnail. - **X-Millicast-Feed-Id**: Dolby.io Real-time Streaming feed id. - **X-Millicast-Stream-Id**: Dolby.io Real-time Streaming stream id. +- **X-Millicast-Token-Id**: Dolby.io Real-time Streaming publish token id. - **X-Millicast-Signature**: SHA1 signature using the hook configured secret (The same signature mechanism used by the other webhooks). ## Troubleshooting @@ -76,6 +77,30 @@ There are a few limitations to be aware of: - Thumbnails cannot be configured to send more or less frequently than every 30 seconds. - Regular intra frames are required to generate the thumbnails. +## On demand thumbnails + +If the thumbnails generated every 30 seconds are not interesting or timed appropriately, you may instead create 'on-demand' thumbnails. +Call the /api/thumbnails endpoint to immediately generate a thumbnail for a streamName and/or tokenId and send it to any configured webhooks. + +``` +curl --request POST \ + --url https://api.millicast.com/api/thumbnails \ + --header 'accept: application/json' \ + --header 'authorization: Bearer {YOUR_API_SECRET}' \ + --header 'content-type: application/json' \ + --data ' +{ + "streamName": "myStreamName", + "tokenId": 12345 +} +' +``` + +Note that the thumbnail setting on the publish token only controls the regularly scheduled thumbnails every 30 seconds and is not required for on demand thumbnails. +On demand thumbnails and scheduled thumbnails may be used in parallel. + +On demand thumbnails are rate limited to 6 per minute per streamName/tokenId combination. + ## Learn more We have some sample code to demonstrate receiving a thumbnail hook and saving it to disk: [Webhook Code Example (download and save)](https://github.com/millicast/samples-millicast-webhooks)