Skip to content

Commit

Permalink
added examples + focs for confluence/get_space_export method
Browse files Browse the repository at this point in the history
  • Loading branch information
gkowalc committed Oct 15, 2024
1 parent bc2a601 commit 03bd7d6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/confluence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ Get spaces info
# Get Space permissions set based on json-rpc call
confluence.get_space_permissions(space_key)
# Get Space export download url
confluence.get_space_export(space_key, export_type)
Users and Groups
----------------

Expand Down
25 changes: 25 additions & 0 deletions examples/confluence/confluence_get_space_export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from atlassian import Confluence

# init the Confluence object
host = "<cloud_instance_url/wiki>"
username = "<user_email>"
password = "<API_TOKEN>"
confluence = Confluence(
url=host,
username=username,
password=password,
)
space_key = "TEST"
confluence.get_space_export(space_key=space_key, export_type="html")
# This method should be used to trigger the space export action.
# Provide `space_key` and `export_type` (html/pdf/xml/csv) as arguments.

# It was tested on Confluence Cloud and might not work properly with Confluence on-prem.
# (!) This is an experimental method that should be considered a workaround for the missing space export REST endpoint.
# (!) The method might break if Atlassian implements changes to their space export front-end logic.

# The while loop does not have an exit condition; it will run until the space export is completed.
# It is possible that the space export progress might get stuck. It is up to the library user to handle this scenario.

# Method returns the link to the space export file.
# It is up to the library user to handle the file download action.

0 comments on commit 03bd7d6

Please sign in to comment.