So you need to use this call to assign media from library to a playlist Swagger UI
as such you need to know the playlistId and of course the mediaId of the media file(s) that you want to assign.
You will want to call GET layout with embed parameter Swagger UI
ie something like
/api/layout?embed=regions,playlists,widgets
Technically you don’t necessarily need widgets
there at this point, but it might be good for you to see the full structure.
if you know your layoutId
then you can filter by it as well ie say your layoutId is 10 then you can call GET layout like this:
/api/layout?layoutId=10&embed=regions,playlists,widgets
Then it will show you only data about that particular layout.
so you will be looking at structure like this:
"regions": [
{
"regionId": 102,
"layoutId": 50,
"ownerId": 1,
"name": "phpunit layout-1",
"width": "1920.0000",
"height": "1080.0000",
"top": "0.0000",
"left": "0.0000",
"zIndex": 0,
"playlists": [
{
"playlistId": 102,
"ownerId": 1,
"name": "phpunit layout-1",
"tags": [],
"widgets": [],
"permissions": [],
"displayOrder": "1"
}
],
So you can see in this example the playlistId
is 102, let’s say the mediaId that I want to assign has id 14, so the final call in postman to assign that media to that playlist will look like that:
If you want to add widgets like text, then you’d use the following call
https://xibo.org.uk/manual/api/#/widget/WidgetTextAdd
Which of course also requires playlistId
Once you have a text widget on a layout (added via API or webUI) then yes you can follow my post in the Edit a Text Widget API - #2 by Peter