This was working fine until this week - now Confluence is only returning 500 unique page_ids when there are 1000s of actual pages in the space. Any idea if there is some limit?
I was previously using
import requests
TOKEN ="1234567890"
BASE_URL = "https://confluence.internal.mycompany.com"
PAGES = set()
def get_all_results():
headers = {'Authorization': f'Bearer {TOKEN}'}
next_link = "/rest/api/space/myspace/content/page?limit=200&start=0" #initial url
while next_link:
url = BASE_URL + next_link
print(f"url: {url}")
try:
response = requests.get(url, headers=headers, verify=False)
data = response.json()
results = data.get('results', [])
links = data.get('_links')
next_link = links.get('next', None)
for result in results:
page_id = result.get('id')
if page_id not in PAGES:
PAGES.add(page_id)
print(f"PAGES: {len(PAGES)}")
except requests.exceptions.RequestException as e:
print(f"Error fetching the URL: {e}")
breaK
return PAGES
if __name__ == "__main__":
get_all_results()
###Results
url: https://confluence.internal.mycompany.com/rest/api/space/myspace/content/page?limit=200&start=0
PAGES: 200
url: https://confluence.internal.mycompany.com/rest/api/space/myspace/content/page?limit=200&start=200
PAGES: 400
url: https://confluence.internal.mycompany.com/rest/api/space/myspace/content/page?limit=200&start=400
PAGES: 500
url: https://confluence.internal.mycompany.com/rest/api/space/myspace/content/page?limit=200&start=600
PAGES: 500
url: https://confluence.internal.mycompany.com/rest/api/space/myspace/content/page?limit=200&start=800
PAGES: 500
Hi,
I get the same issue as you. Are you using Data Center Edition? If yes which version?
BR Franz
We are using version 8.5.8
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm pretty confident that it is a bug. Check out this issue and the closed dupliactes. https://jira.atlassian.com/browse/CONFSERVER-95272?src=confmacro
My guys have planned an update to .9 in the next weeks, I hope it is solved then.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.