I'm able to create/modify pages via the Confluence REST API, but they all appear at the space root. If I move a page manually, and then I update its content via the API, it is moved back to the space root. How do I create a page which has another page as its parent?
Community moderators have prevented the ability to post new answers.
One of the comments in this stack overflow question details how to create the new page as a child of an existing page using the 'ancestors' property:
http://stackoverflow.com/questions/23523705/how-to-create-new-page-in-confluence-using-their-rest-api
But it does warn that this is an undocumented feature.
Yes, great, that comment did the trick.
"ancestors":[{"type":"page","id":12345}]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How do you get the ancestor ID of an existing page? It's always empty (either an empty array or an empty string) when I fetch the page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
NM. Got it working. Here is my description how: https://answers.atlassian.com/questions/5278993/answers/11442314
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.