Hi all,
I am trying to copy a page hierarchy from one space to another space via the Confluence REST API. In the Confluence Cloud API there exists
POST /wiki/rest/api/content/{id}/pagehierarchy/copy
(see https://developer.atlassian.com/cloud/confluence/rest/#api-content-id-pagehierarchy-copy-post).
On the server version I am getting a 404 error when trying to use this interface (note that authorization is not the problem). Is this functionality only available in the cloud version?
PS: In the cloud version it worked fine.
Hi,
For server it'll be
POST /rest/api/content/{id}/pagehierarchy/copy
Hi,I have the same need here (copy a page hierarchy to another space)... I've installed REST api browser, but it really seems like this function is not available on server ...Any ideas, anyone?Thanks,
This is very misleading. There is no such api in Confluence Server.
Did you ever find it?
Hi @Danilo Yasushi Saita , which version of Confluence are you using? It's now possible to copy page hierarchies, since 6.0 https://confluence.atlassian.com/doc/confluence-6-0-release-notes-844235309.html#Confluence6.0ReleaseNotes-6-0-2For previous releases, you can use the addon https://marketplace.atlassian.com/apps/22929/copy-page-tree?hosting=server&tab=overview
https://confluence.atlassian.com/doc/copy-a-page-139013.html
@EdwinI tried to use the syntax you suggest, ie:
I get error 404. Using the python version, the syntax translates to:
url = "https://my.domain/confluence/rest/api/content/11111/pagehierarchy/copy"headers = {"Content-Type": "application/json"}payload = json.dumps( { "copyAttachments": True, "copyPermissions": True, "copyProperties": True, "copyLabels": True, "destinationPageId": "2222222", "titleOptions": { "prefix": "aaa", "replace": "", "search": "" }} )rrr = requests.request( "POST", url, data=payload, headers=headers, auth=("user", "password"),)print(rrr.text)
The user I'm connected to has view page rights on the source space, and successfully created the destination space, using the relevant API. Logged in as that user, the copy operation works when using the UI.
I also tried with "copyPermissions": False, "copyProperties": False, "copyLabels": False,
@Francis Vila Found any way to copy page tree using any Confluence REST API?
It looks like you're new here. Sign in or register to get started.