I can create a page in a space using the confluence api and ajax/jquery but I can't specify for it to be created at a particular part of the page tree structure. For instance, the code below will error off even though EXPERTISE/Personal+Pages is part of my Page Tree structure. The code will successfully create a page if I change the bold part to just the name of the space which is EXPERTISE, however I'd like to create the page in EXPERTISE/Personal+Pages. I've been over the documentation at this link but haven't found a clear answer https://developer.atlassian.com/server/confluence/page-tree-api-documentation/.
// Create a Personal Page
var new_personalpage_data = {
type: "page",
title: user_name_first + "+" + user_name_last,
space: {
key: "EXPERTISE/Personal+Pages"
},
body: {
storage: {
value: "<p>This is a new page</p>",
representation: "storage"
}
}
};
$.ajax({
type:"POST",
url: "https://wiki.company.net/rest/api/content/",
data: JSON.stringify(new_personalpage_data),
contentType: "application/json; charset=utf-8",
success: function () {alert('Personal Page Created!');},
error: function() {alert('Unable to Create a Personal Page for you');}
})
}