I am on Confluence Cloud, as the admin of my org's Confluence Enterprise. I am using PowerShell and trying to use Confluence's REST APIs to move pages and sub-pages from one space to another.
I have the API token/key and my email, and I'm using the the following Windows curl command to move a page:
curl --request PUT --url "https://myorg.atlassian.net/wiki/rest/api/content/pageID" --user "myemailaddress:mytoken" --header "Content-Type: application/json" --data "{ \"id\": \"pageID\", \"type\": \"page\", \"title\": \"Test 1\", \"version\": { \"number\": 4 }, \"space\": { \"key\": \"ABOUT\" }, \"ancestors\": [ { \"id\": \"parentpageID\" } ] }"
Strangely, this leaves the page reference in the old space, and the page also appears in the new space under the parentpageID. If I manually delete the page in either space, it gets removed from both spaces. It's almost as if the page's "pointer" was updated or duplicated, and the page didn't actually move.
Is this expected behavior? Or am I doing something incorrectly? Is there a recommended programmatic way to actually move a page (and its subpages) from one space to another, so that they no longer appear in the original/old space?
Hi @Kunal Ashar
The API you are using will only get the page data and nothing else. You arent gonna move it with it.
Here is a good guide on how to move pages:
https://confluence.atlassian.com/confkb/bulk-move-pages-using-the-confluence-cloud-api-1540735700.html
Please take a look at the cloud API:
https://developer.atlassian.com/cloud/confluence/rest/v1/intro/#about
Regards
Hi @Kunal Ashar
What exactly is your use case for moving pages?
Maybe there's another solution that will do what you want to achieve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The folks in my org are initiating a massive re-organization and consolidation of over 30,000 pages into other spaces and other nested structures, and I need to move those programmatically.
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.