Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Create new page from template via external link

Hans-Florian Piecha August 15, 2019

Hi,

we are trying to create a new page via external link. This link is created in our own application.

I managed to create an empty page with title via this link:

https://compnay.atlassian.net/wiki/pages/createpage.action?
spaceKey=WEB
&title=myTitleWithDate
&linkCreation=true
&fromPageId=1354170460

This is fine for some quick documentation, but for other use cases we´d like to use a template. For now we are using an inbuild template 'Meeting notes' and so I designed a link from our application like this:

https://company.atlassian.net/wiki/pages/createpage-entervariables.action?
templateId=595cdeb6-bba8-4a3d-81fd-31902b6bb504
&spaceKey=WEB
&title=myTitleWithDate
&newSpaceKey=WEB
&fromPageId=1354170460

But this is not working, I get a featureless error message from confluence.

I think, this "template id" I am using, is the blueprint id of the 'Meeting Notes' template, and honestly, I don´t think this is the ID I should be using.

So:

1. Where can I find the real "template id" of an inbuilt template (blueprint)?

2. Would it be better to design our own templates for this use case?

 

Some specs:

Confluence hosted on atlassian.net (not on-premise)

 

Tank you.

best Regards

2 answers

1 accepted

0 votes
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2019

Hello Hans-Florian and welcome to the Community!

This is an interesting idea, creating a page via a URL outside of Confluence. We did find a similar Community article we would like you to review as the users there are attempting the same thing: Can I trigger a template from a link?

Additionally, you may complete this same action via a REST API call. The REST API will allow for a lot more customization around your created content and allow you to be a lot more flexible with what you’re creating. You’ll also not be constrained to the 2083 character limit of URLs. Please review this endpoint for further information: POST /wiki/rest/api/content.

I hope this proves helpful and you’re able to get your templated content created.

Regards,
Stephen Sifers

Hans-Florian Piecha September 3, 2019

Hi, thank you for your answer and sorry for the long delay.

We improved our software recently so we can send and receive data via REST. So this might be a possibility for us. I checked the page you were referring to.

How can I create a new page from a blueprint via REST?

Best Regards

Like Stephen Sifers likes this
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 3, 2019

Hello Hans-Florian,

Glad to hear there are improvements on your end to support REST API calls. With the REST API, you may create pages within Confluence using the following endpoint: POST /rest/api/content. The functionality to create a page using the REST API is not currently supported. There is a feature request to have this functionality added to the product which may be found at CRA-818.

A workaround to this would be to implement a similar method as the following:

  1. Locate an example page with the template applied.
  2. Scrub 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. From this, pass the storage format to your create call using this endpoint: POST /rest/api/content

I hope this information proves helpful and you’re able to start creating pages via the REST API.

Regards,
Stephen Sifers

Deleted user August 6, 2021

Hello @Stephen Sifers ,

 

I tryed to do waht you said above, but the server is returnin error "500".

I created this post bellow, where I explain in more details. 

https://community.developer.atlassian.com/t/create-a-page-content-with-an-template/50694 

0 votes
Jochen Berdi December 23, 2022

Hello

 

our Solution for Confluence Server

https://company.atlassian.net/pages/createpage-entervariables.action?templateId=291930113&spaceKey=JCK&fromPageId=291111893&title=Demand:+Title

TemplateID
You can find it as area admin in the browser address bar in the template preview

 

PageID (Parent Page under which the new page will be created)
You can find it in the browser address bar in the page information view.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events