@@ -91,6 +91,11 @@ def get_page_by_id(self, page_id: str,
91
91
"""
92
92
Returns a page by ID in the v2 API format.
93
93
94
+ API Version: 2 (Cloud only)
95
+
96
+ Compatibility: This method provides similar functionality to the v1 get_page_by_id
97
+ but with a different parameter set and response structure.
98
+
94
99
Args:
95
100
page_id: The ID of the page to be returned
96
101
body_format: (optional) The format of the page body to be returned.
@@ -136,10 +141,16 @@ def get_pages(self,
136
141
get_body : bool = False ,
137
142
expand : Optional [List [str ]] = None ,
138
143
limit : int = 25 ,
139
- sort : Optional [str ] = None ) -> List [Dict [str , Any ]]:
144
+ sort : Optional [str ] = None ,
145
+ cursor : Optional [str ] = None ) -> Dict [str , Any ]:
140
146
"""
141
147
Returns a list of pages based on the provided filters.
142
148
149
+ API Version: 2 (Cloud only)
150
+
151
+ Compatibility: This method is equivalent to get_all_pages_from_space in v1,
152
+ but uses cursor-based pagination and supports more filtering options.
153
+
143
154
Args:
144
155
space_id: (optional) The ID of the space to get pages from
145
156
title: (optional) Filter pages by title
@@ -152,9 +163,10 @@ def get_pages(self,
152
163
limit: (optional) Maximum number of pages to return per request. Default: 25
153
164
sort: (optional) Sorting of the results. Format: [field] or [-field] for descending order
154
165
Valid fields: 'id', 'created-date', 'modified-date', 'title'
166
+ cursor: (optional) Cursor for pagination. Use the cursor from _links.next in previous response
155
167
156
168
Returns:
157
- List of page objects in v2 API format
169
+ Dictionary containing results list and pagination information in v2 API format
158
170
159
171
Raises:
160
172
HTTPError: If the API call fails
@@ -190,8 +202,11 @@ def get_pages(self,
190
202
raise ValueError (f"Sort must be one of: { ', ' .join (valid_sort_fields )} " )
191
203
params ['sort' ] = sort
192
204
205
+ if cursor :
206
+ params ["cursor" ] = cursor
207
+
193
208
try :
194
- return list ( self ._get_paged (endpoint , params = params ) )
209
+ return self .get (endpoint , params = params )
195
210
except Exception as e :
196
211
log .error (f"Failed to retrieve pages: { e } " )
197
212
raise
@@ -267,17 +282,22 @@ def create_page(self,
267
282
status : str = "current" ,
268
283
representation : Optional [str ] = None ) -> Dict [str , Any ]:
269
284
"""
270
- Creates a new page in the specified space.
285
+ Creates a new page in Confluence.
286
+
287
+ API Version: 2 (Cloud only)
288
+
289
+ Compatibility: This method is equivalent to create_page in v1, but with parameter
290
+ differences: space_id instead of space, simplified body format, and no content type.
271
291
272
292
Args:
273
293
space_id: The ID of the space where the page will be created
274
- title: The title of the new page
294
+ title: The title of the page
275
295
body: The content of the page
276
296
parent_id: (optional) The ID of the parent page
277
297
body_format: (optional) The format of the body. Default is 'storage'.
278
298
Valid values: 'storage', 'atlas_doc_format', 'wiki'
279
299
status: (optional) The status of the page. Default is 'current'.
280
- Valid values: 'current', 'draft'
300
+ Valid values: 'current', 'draft'
281
301
representation: (optional) The content representation - used only for wiki format.
282
302
Valid value: 'wiki'
283
303
@@ -336,6 +356,12 @@ def update_page(self,
336
356
"""
337
357
Updates an existing page.
338
358
359
+ API Version: 2 (Cloud only)
360
+
361
+ Compatibility: This method is equivalent to update_page in v1, but requires
362
+ the version number and uses a simplified body format. The v2 update requires
363
+ at least one field (title, body, or status) to be provided.
364
+
339
365
Args:
340
366
page_id: The ID of the page to update
341
367
title: (optional) The new title of the page
0 commit comments