3 Replies Latest reply on Jun 13, 2016 10:13 AM by Bryce Gilhooly

    REST API - applying a place template

    andrew.grieve@arrowgrass.com

      Hi,

       

      What's the easiest way to apply a place template using the REST API?

      I want to automate the Configure -> Browse Templates -> Apply Template functionality.

       

      I've tried the PageService GET /pages/prototype Jive REST API v3.14 → Page service

      but this returns a new page (based on the specified template).  I need the full template applied to an existing place.

       

      Thanks

        • Re: REST API - applying a place template
          Bryce Gilhooly

          Hey Andrew,

           

          I think your best approach would be to..

          1- (Assuming you do not know the placeTemplateId) GET request to /placeTemplates (else get the placeTemplateId)

          2- Grab the tile configuration from the 'tiles' property of the template you want to apply

          3- Do a PUT request on the page you want to apply the template to, using the tiles configuration from above

           

          Full disclosure, I've never done this, but this is how I would start to tackle this problem.

           

          Hope that helps, happy to clarify as needed.

          Bryce.

          1 person found this helpful
          • Re: REST API - applying a place template
            andrew.grieve@arrowgrass.com

            Thanks, that's exactly what I was doing, and I can confirm that it works fine!  Just wondered if there was a more direct way...

             

            I have also upvoted -  - to allow for programmatic setting of the space banner/image via the API.  This will help us set all the spaces up consistently.

              • Re: REST API - applying a place template
                Bryce Gilhooly

                Well I'm glad we're on the same page, and thanks for letting me know that works

                 

                An alternative solution around the space / banner images would be to click your avatar > themes > place banner management

                 

                You can upload images here that will show as banners that users can select from. In the instance that an upgrade requires you to update these images, my understanding is that you can replace the image and it will update all instances where that specific banner was used. While this won't capture every instance, you can at least say that "officially supported" banner images can / will be updated.

                 

                (make sure you use a different file name so the old image doesn't get "trapped" in the cache.)

                 

                Cheers,

                Bryce.