Skip to content

Commit 03bd7d6

Browse files
author
gkowalc
committed
added examples + focs for confluence/get_space_export method
1 parent bc2a601 commit 03bd7d6

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

docs/confluence.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ Get spaces info
240240
# Get Space permissions set based on json-rpc call
241241
confluence.get_space_permissions(space_key)
242242
243+
# Get Space export download url
244+
confluence.get_space_export(space_key, export_type)
245+
243246
Users and Groups
244247
----------------
245248

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from atlassian import Confluence
2+
3+
# init the Confluence object
4+
host = "<cloud_instance_url/wiki>"
5+
username = "<user_email>"
6+
password = "<API_TOKEN>"
7+
confluence = Confluence(
8+
url=host,
9+
username=username,
10+
password=password,
11+
)
12+
space_key = "TEST"
13+
confluence.get_space_export(space_key=space_key, export_type="html")
14+
# This method should be used to trigger the space export action.
15+
# Provide `space_key` and `export_type` (html/pdf/xml/csv) as arguments.
16+
17+
# It was tested on Confluence Cloud and might not work properly with Confluence on-prem.
18+
# (!) This is an experimental method that should be considered a workaround for the missing space export REST endpoint.
19+
# (!) The method might break if Atlassian implements changes to their space export front-end logic.
20+
21+
# The while loop does not have an exit condition; it will run until the space export is completed.
22+
# It is possible that the space export progress might get stuck. It is up to the library user to handle this scenario.
23+
24+
# Method returns the link to the space export file.
25+
# It is up to the library user to handle the file download action.

0 commit comments

Comments
 (0)