How to paginate list of all pages across multiple spaces in confluence using rest api

Hamish Burns
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 28, 2018

I would like to retrieve all the pages from a confluence instance that includes multiple spaces. 

My current query looks something like this:

https://{{host}}/wiki/rest/api/content/search?&cql=lastModified<now("-4w")and%type=page&start=0&limit=1000

 

However this can return a different first 1000 items on different runs. Likewise the second request to get the second page of items can return items that were in the first 1000:

https://{{host}}/wiki/rest/api/content/search?&cql=lastModified<now("-4w")and%type=page&start=1000&limit=1000

Any help would be much appreciated

1 answer

1 accepted

2 votes
Answer accepted
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2018

Hi! 

I suggest to use order by created in your cql.

https://developer.atlassian.com/server/confluence/advanced-searching-using-cql/

 

Also, will this method help you from atlassian-python-api module?

https://github.com/AstroMatt/atlassian-python-api/blob/master/atlassian/confluence.py#L150

 

 

 

Cheers,

Gonchik Tsymzhitov

Hamish Burns
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 29, 2018

Thanks great suggestion

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events