Region can't create

Hello,
I’m trying to add a new region to the layout through API, it keeps giving “This Layout is not a Draft, please checkout” even after I checkout and the layout turn to draft in CMS.

This has been resolved but I will post the answer in case other users encounter this issue.

When using the Add Region call you will see in the documentation that you need to add the layout ID to the path:

image

I have created a test layout in my CMS that I will add a region to. You can see in my screenshot that the ID in your CMS appears to be 704:

image

There is in fact another layoutId for this layout while it is in draft status. You can find this out by using the GET layout call and adding ?showDrafts=1&parentId=<ID of the layout as shown in your CMS> to the end of the call path. You can see in my screenshot below that I have set the parentId to 704 as that is the ID shown in my CMS for that layout:

If you look at the result returned from my call, you can see the layoutId is listed as 707. This is the ID I need to use with the add region call. You can see in my screenshot that the call is successful when I use this layoutId:

Many Thanks.

1 Like