Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Trying to make a child page on an already existing page

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

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

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 =).

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
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

42,695 views 29 133
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you