Dear Community,
I need to create pages from a page blueprint using the Confluence Server REST API.
I wanted to fulfill this requirement in two steps:
1.) Get a list of all page blueprints, so that I can find the id of the page blueprint which I want to use.
2.) Use the appropriate POST call to create a page from this page blueprint.
So, similar to what is shown here for creating spaces with space blueprints:
https://confluence.atlassian.com/confkb/how-to-create-spaces-with-blueprints-through-the-confluence-rest-api-980460886.html
However, it seems like the calls for page blueprints are not documented and do not exist. I searched many pages, including the following but none of them mention what I need:
https://developer.atlassian.com/server/confluence/confluence-server-rest-api/
https://docs.atlassian.com/ConfluenceServer/rest/8.4.0/
To get a list of page blueprints, I tried:
GET https://my-confluence-url.com/rest/api/blueprint
GET https://my-confluence-url.com/rest/api/blueprint/list
GET https://my-confluence-url.com/rest/create-dialog/1.0/page-blueprint/list
GET https://my-confluence-url.com/rest/create-dialog/latest/page-blueprint/list
GET https://my-confluence-url.com/rest/create-dialog/latest/page-blueprint/
GET https://my-confluence-url.com/rest/create-dialog/page-blueprint/list
where my-confluence-url is substituted with the actual url.
All of those tries return an error message of this kind:
{
"message": "null for uri: https://my-confluence-url.com/rest/api/bluprint",
"status-code": 404
}
The REST API itself seems to be working, because the following call returns a list of spaces:
GET https://my-confluence-url.com/rest/api/space
I tried two versions of Authorization headers:
1.) "Basic username:password" - where username and password are substituted with my actual credentials and then encoded to Base64
2.) "Bearer PAT" - where PAT is substituted with the PAT I created for my user in my Confluence profile.
I always include "Accept: application/json" in the header.
My Confluence Server version is 7.19.9.
Is it really not possible to create a page from a page blueprint using the REST API?
Thank you so much if you have any hints.
Hello @Matthias Karl
"Is it really not possible to create a page from a page blueprint using the REST API?"
Yes, it's really not possible. The documentation for Confluence Server v7.19 is correct; those endpoints you've been sending GET requests to really don't exist.
For Confluence CLOUD, the v1 REST API Template endpoints do provide basic management of templates and their content, but there still is no way to create a new page based on a template. You still have to get the ID of a template, copy all the content from it, then put all that content into a new page.
C'est la vie
Thank you very much for your answer David!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are there any new updates to this post for Confluence Data Center V.8+?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.