You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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 ?
Requirement: Python OR Shell Scripts (curl)
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.
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.
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.