Issue in xibo 2.1.0

I am able to create new layout through swagger API but by default it published it and I’m not able to assign library to the layout. So when I’m checking out the layout through the API then also the media not assigned to it and the publish and checkout api showing wrong publish status in response. Can you help me to resolve the issue ?

I have tried the checkout api so that the published one first becomes draft and then associate media with the layout but that also not working for me

Every time you Checkout/Publish a Layout the LayoutId as well as regionPlaylist playlistId and widgetIds will change.

in 2.1 when you create a new layout it is in Published status, when you call Checkout on this Layout ID, in response you will get a new layoutId which is the id of the draft layout that you can edit - ie you should use this new layoutId from checkout response to make changes to the Layout.

Now, regarding library/assign call, it is not called on Layout ID, it’s called on Playlist ID.

Each Layout has at least one region, each region has one regionPlaylist with playlistId.

When you call checkout, in response you will also get regions array, that will have regionPlaylist and inside of that you will see playlistId - that’s the Playlist ID specific to this specific region and that’s the id you should use in the playlist/library/assign/{playlistId} API call.

If you have a Layout in a draft state, then you can get the Layout Id to edit by calling GET Layout API call with parentId parameter set to the layoutId you can see in Layouts Grid.

You can filter GET Layout, by layout name as well, if you don’t know the ids and pass showDrafts parameter to make it show you the editable layout as well ie say

The embed parameter is not necessary, however with it passed it will show you more details ie in this case regions, playlists and widgets will be expanded in the API response.

Regarding Publish/Checkout publishedStatus, indeed the string there does not change correctly in the response, we will get that fixed.
The publishedStatusId is changing correctly and that’s what you can look at 1 - Published, 2 - Draft.
apart from publishedStatusId, the layout that can be edited will also have a parentId, as mentioned earlier.

As a side note, you seem to have /web in your CMS address, that should be addressed before anything else please -

I hope that helps.

1 Like

Thanks a lot. Now it is working.
But I want to ask you one thing when we have checkout, the layoutId has changed and assign media to layout using new playlistId then why in cms it shows the layout with old layoutId ?

It shows you the id of the layout it had when it was last Published - only published layouts are sent to the Players.
Once you Publish your draft then the layout id in grid will also update and, if needed, new layout will be sent to the Players.

Otherwise it would cause more chaos :slight_smile:

1 Like