I have a page that I created using REST API, but it is getting created in root. I want it to be moved under a space hierarchy and also moved as a child item of one of the other page. I am using Powershell REST method and would like an example...
Hi Tejas,
Invoke-RestMethod -Uri ("<a href="http://localhost:8080/confluence/rest/api/content/3604482%22%3Ehttp://localhost:8080/confluence/rest/api/content/3604482%3C/a" rel="nofollow noopener noreferrer">http://localhost:8080/confluence/rest/api/content/3604482</a>") -Method Put
-Headers 'Content-Type: application/json' <span>$Credentials</span>
<span> -Body '{"id":"3604482","type":"page","title":"new page","space":{"key":"Space you need to move to"},"body":{"storage":{"value":"<p>This is the updated text for the new page</p>","representation":"storage"}},"version":{"number":2}}'</span>
To get the page to be created as the child of another page, you need to fill in the "ancestors" key:
http://stackoverflow.com/questions/28468013/how-to-attach-a-page-as-a-child-of-another-page-in-confluence-rest-api
https://answers.atlassian.com/questions/5278993
It looks like you're new here. Sign in or register to get started.