It's possible to use a custom web hook for custom based authentication.
Using web hooks is the recommended way to protect your ingest workflow. Ask us for account upgrades to help with implementations or hosting
Using web hooks for playback is not recommended and not always enabled. Use nanoPlayer Token Security instead.
Set the custom web hook via this api call (linux notation):
curl -X PUT \
-H 'content-type: application/json' \
-H 'x-bintu-apikey: YOUR_BINTU_API_KEY' \
- The custom api call will be called from bintu for each on_play, on_publish, on_play_done, on_publish_done and on_publish_update webhook.
- It's a blocking api call. You need to ensure quick response times. Long response times from the customer api server will create a delay for the time required to start a playout or publish.
- The customer api hook needs to reply with http status code 200, otherwise the bintu api will reject this stream and it's not possible to publish or play the stream.
- The custom api server should response with 200 to accept a stream and with 403 to reject a stream.
Bintu will send a POST request with header
Content-Type: application/x-www-form-urlencoded and body will contain url encoded form data as in the following example:
For the publish_done webhook, the request body also contains the keys bytes_in and bytes_out. The unit of the values is byte.
Its possible to amend this body with custom fields/data by adding the data as query parameter to the stream-name.
Example for publish
This stream name will result in the request body below:
Example for play
Which will result in the request body below:
You might need to url encode your parameters, e.g.
test=123 needs to be url encoded:
- call: 'play_done', Webhook play, publish, play_done, publish_done, update_publish
- name: 'YYstV-BVPq4', stream name
- bytes_in: '575', Bytes, received by rtmp server
- bytes_out: '8516372', Bytes sent by rtmp server
- addr: '184.108.40.206', Client IP Addr
- clientid: '9466245' internal client id (displayed in log and stat)
- time: '46807', number of seconds since play/publish call
- timestamp: '46805903', timestamp of the last audio/video packet sent to the client
Available Parameters per Webhook