Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rob Giffin 2 posts 93 karma points
    Nov 26, 2017 @ 14:58
    Rob Giffin
    0

    How to 'Publish' content using the Umbraco Rest Api?

    I'm creating an app which programmatically creates content (new pages and updates existing pages). I'm using the Umbraco Rest Api (https://our.umbraco.org/documentation/Implementation/Rest-Api/) but can't find a way to publish content using this Api.

    I have no problems fetching content via a GET /umbraco/rest/v1/content/{id}

    I can update values on a content page via a PUT /umbraco/rest/v1/content/{id}

    I can also create new pages via a POST /umbraco/rest/v1/content/

    I've been looking at the Rest Api test cases on Github and have found the publishing route is. '/umbraco/rest/v1/content/published/{id}' but this only accepts a GET so I can't write anything here.

    The app I'm creating is using javascript and ajax calls to carry this out.

    Can anyone help with a recommendation on how to 'publish' updates and new content pages using the Api via an Ajax call?

    Thanks.

  • Rob Giffin 2 posts 93 karma points
    Nov 27, 2017 @ 17:37
    Rob Giffin
    101

    Found a solution myself in the end. I'm using the 0.9 release of the Rest Api and found someone else had already extended this release to include a publish facility using the umbraco c# api.

    So recompiled the rest api 0.9 release with their updated code and everything is now working as expected and I'm able to publish pages.

    Looks like there is a new release of the rest api on it's way in the future, hopefully this will include lots of new features like this.

    The code required to get 0.9 release to publish is below should anyone else need to do the same. https://github.com/umbraco/UmbracoRestApi/pull/16/files

Please Sign in or register to post replies

Write your reply to:

Draft