Search code examples
2sxc

2sxc update an entity to set IsPulished to false


I need to be able to set the IsPublished value of an existing entity to false through the WebAPI. According to https://2sxc.org/en/docs/feature/feature/3360 :

Just so you don't get things wrong: an Update with "IsPublished"=false will not hide the existing entity, but will hide the change you just made.

Is there a way to do this through the WebAPI, or can this only be done through the 2sxc GUI panel?


Solution

  • In v13.02 you can include IsPublished true or false. The behavior will be

    • true will set everything to published
    • false will set it to draft, and if there was a published one before, it will remain published

    In v13.03 you will be able to do true, false and "draft"

    • true will set everything to published
    • false will set everything to unpublished
    • "draft" will set the updated data to draft, and if there was a published one before, that will leave.