Create page from template via REST

Comments

5 comments

  • Avatar
    Johanna Linaker (K15t)

    Hi Volker,

    thank you for reaching out.

    Creating a versioned page from template via REST is officially not supported by our app, but there is a workaround you could try which was mentioned in an Atlassian community post

    1. Locate the page with the template applied.

    2. Fetch that page via a REST API call using the following endpoint: GET /rest/api/content (This will allow you to get the storage format).

    3.  Now, create an empty versioned page to move your content over.

    4. Lastly, edit the page over the normal Confluence REST API with the fetched storage format in step 2 (the response from 3rd step contains the confluencePageId of the versioned page)

    I hope this can be of help

    Cheers,
    Johanna (K15t)

    0
    Comment actions Permalink
  • Avatar
    Volker Weinreich

    Hi Johanna,

    thank you for your quick response. I will try out the steps and then get back to you if necessary.

    Greetings,

    Volker

    0
    Comment actions Permalink
  • Avatar
    Volker Weinreich

    Okay, except that I first have to learn how to parse, store and reuse the HTTP responses, I just can't fetch the body of the user templates with GET. Normal pages are no problem, but the templates don't have a title.

    0
    Comment actions Permalink
  • Avatar
    Johanna Linaker (K15t)

    Hi Volker,

    As I mentioned in the previous reply, there is, unfortunately, no direct solution for creating (versioned) page from templates, as it is not supported by Scroll Versions REST Api nor Confluence as it seems.

    Regarding fetching page template content from Confluence, it also seems to me that it is not straight forward to get the content from the template itself.

    For this, I’d like to suggest to contact Atlassian Support to ask the best way to do that.

    If you have any other questions, please feel free to reach out to our support via support@k15t.com 

    Cheers,
    Johanna (K15t)

    0
    Comment actions Permalink
  • Avatar
    Volker Weinreich

    Okay, thank you.

    I just find it a little weird. Especially if you want to create pages automatically, it makes sense to have exactly defined templates.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk