@@ -121,6 +121,20 @@ not base64-encode them yourself.
121121 page = confluence_v2.get_page_by_id(" 123456789" , body_format = " storage" )
122122 storage_xhtml = page[" body" ][" storage" ][" value" ]
123123
124+ # Alternative Confluence Cloud V2 page read. Use the site URL without a trailing /wiki;
125+ # the client adds the required API context.
126+ from atlassian import Confluence
127+
128+ confluence_v2 = Confluence(
129+ " https://your-domain.atlassian.net" ,
130+ username = " you@example.com" ,
131+ password = " cloud-api-token" ,
132+ api_version = 2 , # Specify API version 2
133+ cloud = True
134+ )
135+ page = confluence_v2.get_page_by_id(" 123456789" , body_format = " storage" )
136+ storage_xhtml = page[" body" ][" storage" ][" value" ]
137+
124138 See the detailed `authentication documentation `_ for Cloud gateway/scoped-token
125139notes and other authentication methods.
126140
@@ -169,15 +183,13 @@ The library now supports Confluence's v2 API for Cloud instances. The v2 API pro
169183
170184.. code-block :: python
171185
172- from atlassian import Confluence
186+ from atlassian import ConfluenceV2
173187
174- # Initialize with v2 API
175- confluence = Confluence (
176- url = ' https://your-instance.atlassian.net/wiki ' ,
188+ # ConfluenceV2 is an explicit Cloud V2 client; no cloud=True flag is needed.
189+ confluence = ConfluenceV2 (
190+ url = ' https://your-instance.atlassian.net' ,
177191 username = ' your-email@example.com' ,
178192 password = ' your-api-token' ,
179- api_version = 2 , # Specify API version 2
180- cloud = True # v2 API is only available for cloud instances
181193 )
182194
183195 # Get pages from a space
0 commit comments