@@ -91,6 +91,11 @@ def get_page_by_id(self, page_id: str,
9191 """
9292 Returns a page by ID in the v2 API format.
9393
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+
9499 Args:
95100 page_id: The ID of the page to be returned
96101 body_format: (optional) The format of the page body to be returned.
@@ -136,10 +141,16 @@ def get_pages(self,
136141 get_body : bool = False ,
137142 expand : Optional [List [str ]] = None ,
138143 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 ]:
140146 """
141147 Returns a list of pages based on the provided filters.
142148
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+
143154 Args:
144155 space_id: (optional) The ID of the space to get pages from
145156 title: (optional) Filter pages by title
@@ -152,9 +163,10 @@ def get_pages(self,
152163 limit: (optional) Maximum number of pages to return per request. Default: 25
153164 sort: (optional) Sorting of the results. Format: [field] or [-field] for descending order
154165 Valid fields: 'id', 'created-date', 'modified-date', 'title'
166+ cursor: (optional) Cursor for pagination. Use the cursor from _links.next in previous response
155167
156168 Returns:
157- List of page objects in v2 API format
169+ Dictionary containing results list and pagination information in v2 API format
158170
159171 Raises:
160172 HTTPError: If the API call fails
@@ -190,8 +202,11 @@ def get_pages(self,
190202 raise ValueError (f"Sort must be one of: { ', ' .join (valid_sort_fields )} " )
191203 params ['sort' ] = sort
192204
205+ if cursor :
206+ params ["cursor" ] = cursor
207+
193208 try :
194- return list ( self ._get_paged (endpoint , params = params ) )
209+ return self .get (endpoint , params = params )
195210 except Exception as e :
196211 log .error (f"Failed to retrieve pages: { e } " )
197212 raise
@@ -267,17 +282,22 @@ def create_page(self,
267282 status : str = "current" ,
268283 representation : Optional [str ] = None ) -> Dict [str , Any ]:
269284 """
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.
271291
272292 Args:
273293 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
275295 body: The content of the page
276296 parent_id: (optional) The ID of the parent page
277297 body_format: (optional) The format of the body. Default is 'storage'.
278298 Valid values: 'storage', 'atlas_doc_format', 'wiki'
279299 status: (optional) The status of the page. Default is 'current'.
280- Valid values: 'current', 'draft'
300+ Valid values: 'current', 'draft'
281301 representation: (optional) The content representation - used only for wiki format.
282302 Valid value: 'wiki'
283303
@@ -336,6 +356,12 @@ def update_page(self,
336356 """
337357 Updates an existing page.
338358
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+
339365 Args:
340366 page_id: The ID of the page to update
341367 title: (optional) The new title of the page
0 commit comments