The Confluence Cloud v2 REST API endpoint to create a page takes a parentId parameter to specify a parent content ID. The docs don't narrow down the parent content type, but setting a database as parent seems to fail.
How to specify a non-page content type as parent of a page, like a parent database, or a parent whiteboard, or a parent folder?
Users can manually make pages children of those non-page content types.
The API returns a 500 server error when trying to use a database as parentId of a page:
{"errors":[{"status":500,"code":"INTERNAL_SERVER_ERROR","title":"Internal Server Error","detail":null}]}
(I also checked if there is a general issue with databases as parent, but setting the parentId of a database to another database succeeds. Also, setting a page as parent of a database succeeds. But database as parent of a page? Nope. Folder as the parent of a page? Nope again.)
Hello @Heinrich Ulbricht _WikiTraccs_
Good news, you can do it... but it's a two step process.
After you have created the page, you then use the v1 Move a page to a new location endpoint and append that page to the other content type (database, folder, whiteboard etc) that you want as the parent.
Even though the endpoint refers to pages, it works on all content types, so you can use it to move any content (and its descendents) to any specific location anywhere in the content tree.
Tested and it works. Perfect workaround, thank you.
I'm using this for now, but still hope for the parentId to start working at some point...
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.