Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,028
Community Members
 
Community Events
168
Community Groups

How can I create confluence page using a template

Hi,

I want to create a confluence page using a user defined template via rest api call.

I have tried the following methods

curl -u username:api_token -X POST -H 'Content-Type: application/json' https://xxxxxxx/wiki/spaces?{space_name}/pages/createpage-entervariables.action?templateId=tempalte_id&spaceKey=space_key&title=Test_Release_automation2&newSpaceKey=space_key&fromPageId=parent_page_id

but the page is not getting created 

I have also tried,

curl -u username:api_token -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"Test_release_automation3","ancestors":[{"id":parent_page_id}],"space":{"key":"space_key"},"templateId":template_id,"body":{"storage":{"value":"","representation":"storage"}}}' https://xxxxxx/wiki/rest/api/content/ | python3 -mjson.tool

 

using this method I am able to create the page but the specified template is not getting used. The created page is blank.

 

I would like to know what i am doing wrong in both cases.

Also i want to know that is there any other way to create a confluence page using a template via api call.

 

Thanks

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

Atlassian Community Events