SYNQ webhooks are more fancy than your ordinary webhook, they are programmable!
Webhooks allow you to send information over HTTP when certain events happen for a video object.
There are three event handlers you can add your code, they are added on a pr. project basis.
on_video_create(video)is executed whenever a video object is created.
on_video_update(oldVideo, newVideo)is executed whenever anything inside a video object changes.
on_video_delete(video)is executed whenever a video object is deleted
To add your code to any of these events, go to www.synq.fm/dashboard click the project you want to add the event listener to. Write your code directly into the code boxes there and remember to flip the active switch.
Each event can only take a single top level function with the correct function name and signature as listed above.
This will be run whenever a video is uploaded to our service, and might be a good place to run your code if you want to do something that is not dependent on a video being transcoded or processed.
The update event is where most webhooks should probably be run. Check for some value to become available in the video object, then notify another service by making a http request.
The external service could then change the video object and trigger a new run of this function allowing for complex and flexible workflows.
Note: Any change to the video object will trigger a call to this function. This means you have to check for transitions between old and new video object. If you just check for the existence of a field any later change to the video object will evaluate to true.