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

Rest API - how to insert children display micro while creation of page

Hello,

I am using confluence rest api and python module requests to create multiple pages in confluence. 

I will have parent and child hierarchy of pages. I want to insert children display macro at parent page using rest api call. 

code sample: 

invpagebodyhtml = "<p><b>This page is published by automation tool.</b></p>"
create_page = json.dumps(    {        "type""page",        "title""testing-notification",        "space": {"key""TEST"},        "ancestors": [{"id"1234567}],        "status""current",        "body": {"storage": {"value": invpagebodyhtml, "representation""storage",}},    })

response = requests.request(    "POST", URL, data=create_page, headers=headers,)

any help on how to include that macro here? 

Thanks

Sukh

1 answer

1 accepted

0 votes
Answer accepted

I got it worked with adding this to my html 

 

old html: 

invpagebodyhtml  = '<p><b>This page is published by automation tool.</b></p>'

 

new html:

invpagebodyhtml  = '<p><b>This page is published by automation tool.</b></p><p><ac:structured-macro ac:name=\"children\" ac:schema-version=\"1\" /></p>'

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

3,138 views 4 6
Join discussion

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