Generating a Playlist of CGs, Graphics, Audio Clips, or Video Clips in a Rundown Using the Rundown Creator API
With Rundown Creator, it's super simple to put things like CGs, graphics, audio clips, or video clips into scripts. And with the Rundown Creator API, getting all of the information you'll need to generate a playlist is just as easy too. Here's how you do it...
Objects only have two requirements:
1. They must have a type. In the examples above, the first object is a cg, and the second object is a video, but objects can be whatever type you want
2. They must have an id attribute. This is used for tracking purposes
Objects can have as many or as few optional parameters as you like, and they can be anything you want. In the examples above, the first object has three optional parameters: template, line1, and line2. The second object has only one: file
In the example request above, GetObjects set to true tells the Rundown Creator API that we want it to return an array of objects in each row. Type set to cg tells it we only want cg's. GetRowsWithoutObjects set to false tells the Rundown Creator API not to return rows without cg's in them. And likewise, Floated set to false tells it not to return rows that are floated. Of course, you can adjust these parameters and any others that the getRows method accepts to fit your needs.
...And that's the JSON-formatted response. Now you should be able to create a playlist by iterating through the array of rows, and the array of objects in each row.
Step 1: insert a few "objects" into your scripts
That's what we call things like CGs or video clips that you put into your scripts. They can be other things too, like audio clips, graphics, you name it. Here are a few examples of what an object might look like:<cg id="" template="lowerthird" line1="Ron Burgundy" line2="Channel 4 News">or
<video id="" file="BreakingNewsAnimation.mov">
Objects only have two requirements:
1. They must have a type. In the examples above, the first object is a cg, and the second object is a video, but objects can be whatever type you want
2. They must have an id attribute. This is used for tracking purposes
Objects can have as many or as few optional parameters as you like, and they can be anything you want. In the examples above, the first object has three optional parameters: template, line1, and line2. The second object has only one: file
Step 2: getting the rows/objects in a rundown
Since we want to build a playlist of objects in a rundown, we're going to need a list of rows in the rundown, and a list of objects in each row. Luckily, it's pretty easy to get this using the getRows method with a few optional parameters. Here's an example request:Example request
https://www.rundowncreator.com/channel4news/API.php ?APIKey=edharken &APIToken=HNe2ADG0nBTiC8Q8WiVfsxeG5ip51A &Action=getRows &RundownID=1 &GetObjects=true &Type=cg &GetRowsWithoutObjects=false &Floated=false
In the example request above, GetObjects set to true tells the Rundown Creator API that we want it to return an array of objects in each row. Type set to cg tells it we only want cg's. GetRowsWithoutObjects set to false tells the Rundown Creator API not to return rows without cg's in them. And likewise, Floated set to false tells it not to return rows that are floated. Of course, you can adjust these parameters and any others that the getRows method accepts to fit your needs.
Example response
[ { "RowID": 3, "RundownID": 1, "Position": 20, "PageNumber": "A2", "StorySlug": "INTRO", "writer": "", "editor": "", "segment": "LIVE", "talent": "RON", "camera": "NEWSROOM", "effect": "", "graphic": "", "source": "", "vtr": "", "file": "", "Break": 0, "ScriptHasContent": 1, "Approved": 0, "Floated": 0, "Locked": 0, "Following": 0, "EstimatedDuration": 0, "ActualDuration": 26, "Objects": [ { "ObjectID": 1, "Type": "cg", "Payload": { "id": "1", "template": "lowerthird", "line1": "Ron Burgundy", "line2": "Channel 4 News" }, "RawData": "<cg id=\"1\" template=\"lowerthird\" line1=\"Ron Burgundy\" line2=\"Channel 4 News\">", "Status": "Not Ready" } ], "Deleted": 0 }, { "RowID": 4, "RundownID": 1, "Position": 30, "PageNumber": "A3", "StorySlug": "PANDA WATCH", "writer": "", "editor": "", "segment": "VO", "talent": "RON", "camera": "", "effect": "TOP", "graphic": "TONIGHT ON THE CHANNEL 4 NEWS", "source": "", "vtr": "A", "file": "", "Break": 0, "ScriptHasContent": 1, "Approved": 0, "Floated": 0, "Locked": 0, "Following": 0, "EstimatedDuration": 0, "ActualDuration": 0, "Objects": [ { "ObjectID": 2, "Type": "cg", "Payload": { "id": "2", "template": "1line", "line1": "Tonight on the Channel 4 News" }, "RawData": "<cg id=\"2\" template=\"1line\" line1=\"Tonight on the Channel 4 News\">", "Status": "Not Ready" } ], "Deleted": 0 } ]
...And that's the JSON-formatted response. Now you should be able to create a playlist by iterating through the array of rows, and the array of objects in each row.