API - This Layout is not a Draft, please checkout

I’m trying to change a local video inside a layout. I have verified that I am using the correct widget id but am not having any luck getting the video to change. I keep getting the following;

{{url}}/api/playlist/widget/16?localVideo=&uri=\pathtofile

{
“error”: 422,
“message”: “This Layout is not a Draft, please checkout.”,
“property”: “layoutId”,
“help”: null
}

I’ve verified that the layout is checked out
{{url}}/api/layout/checkout/16

{
“error”: 422,
“message”: “Layout is already checked out”,
“property”: “statusId”,
“help”: null
}

Any suggestions? Did the id change while it is in draft mode?

As far as I know, yes, the IDs of the widgets change, even the ID of the layout changes when you publish it.

Do you know how to check what the id is once put into draft mode? When using the code GET /layout , it still lists my widget as having the same id?

Honestly, there is a way that is definitely not recommended, and not even correct using “inspect elements”:

But obviously there must be a much smarter way to do this… Maybe it’s worth looking in the database tables for the relationships between layout IDs, playlist IDs, and widget IDs…
But it’s a start… I think other people here may be able to help you more than I can.

We really need this to happen programmatically. We’re trying to dynamically change the video source inside of a Local Video widget. The video playing is a training video. We would like the user to scan a barcode, we manipulate the barcode data to create a link for the training video related to the qr code scanned.