Autopagination in python

Hi,

Is there a way to autopaginate using python instead of changing the page_number as per the below

etUsers = json.loads(userAPI.get_users(page_size=500, page_number=1.to_json())
etUsers = json.loads(userAPI.get_users(page_size=500, page_number=2).to_json())

Thank you

Hi Chris,

No. The APIs are paginated and currently we generate the SDKs directly off the APIs via swagger. In the CLI, we have a layer of code sitting above our API's calls that will do the auto-pagination. We have talked about doing this in the SDKs code generation process, but we have not put it on our roadmap yet.

Thanks,
John Carnell
Manager, Developer Engagement

Hi John,

Thank you, appreciate the response.

Kind Regards,
Chris

I managed to get around it with a while loop using a counter.

for example:

count = 1
while count < 9:
getUsers = json.loads(userAPI.get_users(page_size=500, page_number=count).to_json())
count = count + 1

Thanks again.

1 Like