Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Trying to make a child page on an already existing page

Sufficient Monk January 6, 2022

Right now the structure of the pages looks something like this:

doubt3.png

 

 

I am trying to add a sub-page to the parent page.
My plan is to first just make a new page in the space.
And then using the command Update in the rest API  to change the ANCESTOR of my new page to be the PARENT PAGE.


to be able to do the second step though, I need the ID of the Parent page. And this is where my problem is:

my Problem: HOW CAN I FIND THE ID OF A PAGE?
do  pages even have ID's in confluence.
I do not see any API commands to be able to get data about child pages. 

What I  have tried the command :
GET /rest/content/{id}/child
where I inserted the number ID of the space . But I get an error message saying not found.

 doubt 4.png

 

Summary: So I am not really sure how I can get the ID of the PARENT PAGE to be able to set the ancestor of my newly created page to be a subpage of the PARENT PAGE . [basically set the parent page as an ancestor of the new page]

 

 

1 answer

1 accepted

1 vote
Answer accepted
Bastian Stehmann
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 6, 2022

Hi @Sufficient Monk ,

I think you have to get the space data first and expand the homepage data. There you should get the ID of the homepage. With that ID you can get that page and its child pages, with that you should get page ID from the children.

https://developer.atlassian.com/cloud/confluence/rest/api-group-space/#api-wiki-rest-api-space-spacekey-get

Sufficient Monk January 6, 2022

Yes I have switched over to using the documentation of Atlassian Cloud even though we do not use it. Since the documentation at https://docs.atlassian.com/atlassian-confluence/REST/6.6.0/#space/{spaceKey}/property-create is so bad....

Übrigens bin selber noch im Deutschland =).

Bastian Stehmann
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 6, 2022

Alles klar, dann hoffe ich, dass du damit erstmal weiter kommst.

Like Sufficient Monk likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events