i'm using Confluence Rest Api to create a new page :
That's my input
"{\"id\":null,
\"type\":\"page\",
\"title\":\" my new page\",
\"space\":{\"key\":\"TST\"},
\"status\":\"current\",
\"container\":{\"Id\":null,\"Type\":null},
\"ancestors\":[{\"Id\":2150269501}],
\"body\":{\"view\":null,\"export_view\":null,\"styled_view\":null,\"storage\":{\"value\":\" This page was created automatically \",
\"representation\":\"storage\"},\"editor\":null,\"editor2\":null,\"wiki\":null,\"anonymous_export_view\":null,\"plain\":null,\"atlas_doc_format\":null,\"raw\":null}}"
ancestor is the id of an existing page.
the new page is created, but on top level, not as child of my ancestor page.
What is wrong ?
Hi @Björn Welcome to the Atlassian Community.
I was able to create a child page with below JSON Body. In below example - 1234 is the page ID of my parent page under which i wanted to create a child page -
POST - https://kishansharma.com/wiki/rest/api/content
{
"type":"page",
"title":"Created-From-API",
"space":{
"key":"KishanSharma"
},
"ancestors": [
{
"id": 1234
}
],
"body":{
"storage":{
"value":"some-text",
"representation":"storage"
}
}
}
Hello Kishan,
that helped me. Thanks a lot.
it works now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great, you are welcome @Björn , please accept the answer if you have found it useful, so that it will help others having similar query in future.
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.