@@ -207,14 +207,15 @@ def get_child_pages(self, page_id):
207
207
"""
208
208
return self .get_page_child_by_type (page_id = page_id , type = "page" )
209
209
210
- def get_page_id (self , space , title ):
210
+ def get_page_id (self , space , title , type = 'page' ):
211
211
"""
212
212
Provide content id from search result by title and space
213
213
:param space: SPACE key
214
214
:param title: title
215
+ :param type: type of content: Page or Blogpost. Defaults to page
215
216
:return:
216
217
"""
217
- return (self .get_page_by_title (space , title ) or {}).get ("id" )
218
+ return (self .get_page_by_title (space , title , type = type ) or {}).get ("id" )
218
219
219
220
def get_parent_content_id (self , page_id ):
220
221
"""
@@ -269,7 +270,7 @@ def get_pages_by_title(self, space, title, start=0, limit=200, expand=None):
269
270
"""
270
271
return self .get_page_by_title (space , title , start , limit , expand )
271
272
272
- def get_page_by_title (self , space , title , start = 0 , limit = 1 , expand = None ):
273
+ def get_page_by_title (self , space , title , start = 0 , limit = 1 , expand = None , type = 'page' ):
273
274
"""
274
275
Returns the first page on a piece of Content.
275
276
:param space: Space key
@@ -278,12 +279,13 @@ def get_page_by_title(self, space, title, start=0, limit=1, expand=None):
278
279
:param limit: OPTIONAL: The limit of the number of labels to return, this may be restricted by
279
280
fixed system limits. Default: 1.
280
281
:param expand: OPTIONAL: expand e.g. history
282
+ :param type: OPTIONAL: Type of content: Page or Blogpost. Defaults to page
281
283
:return: The JSON data returned from searched results the content endpoint, or the results of the
282
284
callback. Will raise requests.HTTPError on bad input, potentially.
283
285
If it has IndexError then return the None.
284
286
"""
285
287
url = "rest/api/content"
286
- params = {}
288
+ params = {"type" : type }
287
289
if start is not None :
288
290
params ["start" ] = int (start )
289
291
if limit is not None :
0 commit comments