OktaAPI Python list users returns only 200 users

Hi,

I downloaded and setuo Python SDK from Github.

But when I am executing the below method, I am getting only 200 users from the whole organization of 30000+ users.

async def main():
    users, resp, err = await okta_client.list_users()
    for user in users:
        print(user.profile.first_name, user.profile.last_name)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Kindly someone help me to find out the issue

Thanks

Our APIs implement pagination and most endpoints will by default return a max of 200 records. You can find an example of how to use pagination with the Python SDK in our README:

from okta.client import Client as OktaClient
import asyncio

async def main():
    client = OktaClient()
    users, resp, err = await client.list_users()
    while True:
        for user in users:
            print(user.profile.login) # Add more properties here.
        if resp.has_next():
            users, err = await resp.next()
        else:
            break

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.