Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create confluence page using a template

Nimisha P September 13, 2022

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
AUG Leaders

Atlassian Community Events