I use the following code to create a child page under an existing parent:
curl -v -u admin:password -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"Created by API", "ancestors":[{"id":97585021}], "space":{"key":"Some_Key"},"body":{"storage":{"value":"<p>This is a test page created by API. Pls ignore</p>","representation":"storage"}}}' https://confluence.ges.symantec.com/rest/api/content/ | python -mjson.tool.
Using this I'm successfully able to create a child page under the parent content id 97585021.
What I would like to do next is: create a page under the parent id 97585021 using another page that acts as a template. The template page is in Confluence under the same content id 97585021. So I would like all pages to be created as a copy of this page.
How can I achieve this?
First step, simply get the page body content of your template in Confluence: https://confluence.ges.symantec.com/rest/api/content/1234?expand=body.storage
Ref.: https://docs.atlassian.com/confluence/REST/latest/#content-getContentById
With the extracted body content, make some modifications if necessary, and finally create your child page by doing the exact same request you did.