First step: authenticate
In order to prevent anybody from messing up with the Node, destructive (or playout) commands need to be authenticated by a token. That token is received by the "unlock" get command.
Here is how it works with the default "1234" password:
http://127.0.0.1:4001/unlock?password=1234
That will give you a token that will be valid until someone else authenticates (only one person can control the Node at a time). That other person could be authenticating with Manager, Live, Telnet or HTTP RESTful.
So, if it fails, simply grab another token by repeating the above command.
Second step: send the playlist
Once you have the token (and assuming it is still valid), you can simply append it to the command as a parameter.
Here is an example of the PUT command to send the items of a playlist (all at once).
http://127.0.0.1:4001/playlist/items?token=D54C412B-BF13-49E7-8422-53256B8D4E6B
and then, in the request headers, add this:
Content-Type: application/json
and finally, here is the body of your request. It is a simple JSON dictionary:
[
{
"clipInfoPlaybackUniqueID" : "81A84A0D-C95A-4B8C-B031-3E72289579DB",
"clipInfoHasInPoint" : false,
"clipInfoOnline" : true,
"clipInfoAttributes" : {},
"clipInfoAbsolutePathToMediaItem" : "/Users/daniel/Desktop/KCLV TV/LuxeTV/LUXETV-Filler_Escape-1.mov",
"clipInfoDisplayVideoOriginX" : 0,
"clipInfoOutPointInSeconds" : 0,
"type" : "MediaItem",
"clipInfoDurationInSeconds" : 175.8,
"clipInfoUniqueID" : "1E5817A7-E548-4DFF-8E71-D4624F7DEFEA",
"clipInfoMediaFolderUniqueID" : "02B45B2F-3771-4504-A7A3-6B44D779A432",
"clipInfoInPointInSeconds" : 0,
"clipInfoDisplayVideoOriginY" : 0,
"clipInfoDisplayVideoSizeWidth" : 0,
"clipInfoDisplayVideoSizeHeight" : 0,
"clipInfoHasOutPoint" : false,
"clipInfoMediaItemUniqueID" : "HFTJ-ROIP-TF3N-6D7B-8C0V-0000"
},
{
"clipInfoPlaybackUniqueID" : "907C9E51-05C1-4E0C-AE2D-5CE55BE69742",
"clipInfoHasInPoint" : false,
"clipInfoOnline" : true,
"clipInfoAttributes" : {},
"clipInfoAbsolutePathToMediaItem" : "/Users/daniel/Desktop/KCLV TV/LuxeTV/LUXETV-Filler_Escape-2.mov",
"clipInfoDisplayVideoOriginX" : 0,
"clipInfoOutPointInSeconds" : 0,
"type" : "MediaItem",
"clipInfoDurationInSeconds" : 176.96,
"clipInfoUniqueID" : "0C645779-E730-4399-B56C-049E7896FC23",
"clipInfoMediaFolderUniqueID" : "02B45B2F-3771-4504-A7A3-6B44D779A432",
"clipInfoInPointInSeconds" : 0,
"clipInfoDisplayVideoOriginY" : 0,
"clipInfoDisplayVideoSizeWidth" : 0,
"clipInfoDisplayVideoSizeHeight" : 0,
"clipInfoHasOutPoint" : false,
"clipInfoMediaItemUniqueID" : "H5I8-FPQQ-MZCM-OE45-7BIL-0000"
}
]
Most of the clip information is not needed (but I took the playlist from a GET command, so I've received everything), the only needed stuff is
- clipInfoAbsolutePathToMediaItem = mandatory. It is the path to the clip (absolute)
- clipInfoPlaybackUniqueID = mandatory. It must be unique as its name implies, and consistent in between imports. You can use your own.
- clipInfoMediaFolderUniqueID = important, this is the Unique ID of the media folder in which the file is located. You can not use your own. It needs to be retrieved from the Node first.
- clipInfoMediaItemUniqueID This is not mandatory, and will be used only in case the file can not be found at the path, the Node will search in its database if he can find the file with that unique ID at a different location. It's just a safe thing to get, but you will need to retrieve that information from the Node first. You can not generate it your self.
You will then get a dictionary back with either an error or this dictionary:
{
"success" : true
}
More info on the Node REST API:
IF you want to know more about the REST API with OnTheAir Node, the protocol can be consulted at any time with the OnTheAir Node application. Just go on the computer where OnTheAir Node is installed and is running and type in a browser:
http://127.0.0.1:4001/help.html
This should open a page with the complete protocol and calls you can make.
Comments
0 comments
Please sign in to leave a comment.