As a user, how do I setup webhooks to receive notifications when a clip (episode) is being published?
Introduction
Omny Studio provides webhooks subscription which will allow us to send notifications to an endpoint. General information and guide on how to setup a webhook can be found in this article.
After setting up the webhook subscription, you will be able to then be able to configure the settings to receive notifications when a clip is being published.
Webhook Settings
You can find the webhook settings on "Webhooks" page of your "Organization settings". Clicking on the ...
and the Edit webhook
button will bring you to the Edit webhook
page.
By default, setting up a webhook subscription will allow you to receive all events that Omny Studio provides.
For the purpose of receiving a notification when a clip (episode) is being published, you can focus specifically on the Clip visibility changed (ClipVisiblityChanged)
event. This event can be used to identify whether a clip has been published or unpublished.
By selecting this event, you will get notifications when a clip has been published or unpublished.
Notifications sent for this event will be of the following JSON structure:
{
"Type": "ClipVisibilityChanged",
"Timestamp": "2020-08-13T01:56:00Z",
"EventId": "37a2dae4-4bc0-473b-b8c5-ac1600c4b376",
"ChangeId": "f07876b6-ea54-4246-ab17-49b9d70ed16a",
"Current": {
"Id": "7749ccba-664c-46fd-8cc0-ac16009e4659",
"Title": "Publish Clip Example",
"Visibility": "Unlisted",
...
}
}
As can be seen above, the type of notification is of a ClipVisibilityChanged
type. The property that will help you identify the publish status of a clip is the Visibility
property.
Using the property's values, you can identify when a clip has been published by the user.
Notice: By default, all clips that have just been created will have a publishing status of private
. If the user has not changed the default status on the clip creation page, the ClipVisibilityChanged
event will not be sent out. However, if the user creates a clip and sets the publishing status to anything else besides Private
, a ClipVisiblityChanged
event will be sent out with the proper status set in the Visibility
property.
Creation of a Clip with a default Private status
Clicking on the save above will not send a ClipVisibilityChanged
event as the Publishing status is set to Private
on the Create Clip screen.
Creation of a Clip with a Public/Unlisted/Restricted status
Clicking on the save in this instance will send a ClipVisibilityChanged
event when the Publishing status is set to Restricted, Unlisted, or Public on the Create Clip screen.