Using Search & Execute Framework for Automation
Triggering actions when metadata on assets in changed in Zoom is what the Search & Execute automation framework is about. You can code actions in your choice of programming language: Python, NodeJS, Perl, Ruby etc. Zoom will periodically callback your registered action with the list of affected assets when the metadata conditions are met.
Procedure
Step 1: Save a Search
Before you can attach an action, you must define a metadata driven search, that applies the metadata condition to return a list of matching assets. Use the Asset Browser > Advanced Search to create a saved search with as many metadata conditions as needed:
Be sure to name the search and mark it as a periodic search in Asset Browser:
Once you have marked it as a periodic search, you can now attach actions to it in the Asset Browser or the Web Administration Console. You may need your Media Manager to access the console.
Step 2: Upload Action
First upload your action such as a Python script or an executable to the Zoom server’s script deploy directory. You can open the Search & Execute configuration panel in Web Administration Console by clicking:
Step 3: Attach Action
Enable the periodic saved search in the Search & Execute settings and chose the action you wish to trigger when the metadata in your saved search matches one or more assets. For example, to insert links to published videos in a CMS, a developer can attach a Python action that constructs the Asset ID URL for each asset marked as published and then uses the CMS APIs to insert a link. This can be done in the Asset Browser on the saved search itself or in the Web Administration Console:
Writing your action
Your script will receive a single parameter as input. This will be a path to a CSV or a TAB delimited report file as configured in the Search & Execute settings. The file will contain the metadata field values in each column. The order of the metadata field is controlled by you when you setup the metadata fields under Report Customizations in Search & Execute settings.
You can iterate over the rows in the report to fetch fields like Asset ID, File Path etc to construct your business logic that uses Zoom REST APIs or an external system’s API to take action.
Since the action is invoked periodically, you will need to ensure the business logic is short lived. A common design pattern would be to invoke the action to enqueue a job or an event in your job framework of choice.
Next Steps
Zoom REST API Reference
In this article you will find helpful notes with links to our OpenAPI (Swagger) specification for each of our REST API Group.
- Last modified on