We want to export all of our pages in confluence space as a separate word file. Since the project is huge, we cannot do the export page by page. Is there an easy way to do this? Also, we want to include the attachments in the export. These exports will later be stored in service now knowledge base. How can we achieve this ?
Hi,
Requirement: Python OR Shell Scripts (curl)
Process:
Fetch all the pages id using GET - https://<URL>/wiki/rest/api/space/<space key>/content?start=0&limit=9999&type=page
Now using scripts - iterate the page id for the below and save the output with the page name from the above
GET at https://<URL>/wiki/exportword?pageId=<page id>
:) - Probably save the list of page id and names in an CSV and iterate that CSV as curl to save the output which would be word file.
PS: You might need to do some checks in the scripting (shell would be easy) an can be run from the system with internet.
Hi Piyush,
Thanks for the response and sharing related links. I see this works if the page has an image. what about other attachments for ex: csv, docx that are attached to a page? Is there an easy way to download all these attachments?
Or do we have to iterate through the API as mentioned in this article and download all the attachments? - somehow we are unable to download attachments using the API mentioned in this article.
Regards
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To download all attachments, fist you list to list them with
For each attachment ID you need to get the download URL with
Finally, with the URL, you can download the attachment using curl and store it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are able to download all the attachments of a page using below API
https://<url>/wiki/download/all_attachments?pageId=<pageid>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.