Order items API

Hello, i am building simple CMS for my client and i have several questions about API control:

  • can i delete images/videos from timeline via API ?
  • is it possible to reorder elements via API also ?
1 Like

In short: Yes and yes.

Slightly longer version:
call GET layouts with embed parameter set to regions,playlists,widgets
can be used to get the playlistId and widgetId

Once you know that you can:

Remove widgets - Swagger UI

Regarding playlist/order/{playlistId}

Let’s explain that on an example.

I’ve created a new layout id 79, added 2 images to a single region.

So I will call
/api/layout?layoutId=79&layout=&embed=regions,playlists,widgets

Which will give me my playlistId (151) and widgets Ids (270 and 271)

now I can call the /playlist/order/{playlistId}
ie in my case

/api/playlist/order/151

that call takes an array of widget Ids in a parameter called widgets with values corresponding to the display order in which they should appear.

ie if I would want to reverse the order of my images I could do it like that:
image

so now widgetId 270 will have displayOrder = 2 and widgetId 271 will have displayOrder = 1

I hope that helps, if anything isn’t clear please ask.

Hello, i have tried this via Postman but i cant figure it out to work. This is pretty simple job to do :frowning:

Any idea ?

I might need to know what exactly is the problem to help you.

Could you please tell me at what step are you now and what seems to be a problem?
Screenshot of the call you have might be helpful as well so I can easier see what could be wrong.

Hello, i have build my own cms that “talks” via api to the xibo and everything is working except ordering.

I have tried via postman but no luck, aslo i have follow your steps…

What am i doing wrong ?

You don’t need to pass the auth credentials with every call, actually I don’t think it would work like that anyway.

That aside, at a guess you didn’t list all widgetIds that you have in that playlist, I believe you need to list all of them with the desired displayOrder for it to work - perhaps try that on an easier example with 2-3 widgets in a playlist.

Hello, you are right Peter :slight_smile:

I wasn’t thinking that i need all items to create ordering…

Thank you…

What are you trying to achive with this ?