Calls

Paginated Requests

4min

Several calls in the API return large lists of items. In order to moderate bandwidth, the API will break up these returns into smaller sets, and you will have to make multiple calls in order to collect all of the information. The limit per page is 50 items.

Code Samples

The code samples below will show you how to paginate through a get_user_list call.

Inspecting the basic return

First, if you're unsure of the amount of users which will be included in the return, you can begin by making the call with starting_position not included in doc. This will give you information on what you can expect from the return.

Python


In the top of the response, total_users will show you the total number of users in the return, while records_per_page will tell you how many will be included in each page.

JSON


Making the paginated call

The things to note here are that you need to increment starting_position for each call. Inside the loop, this variable is updated within payload, and the parent and child users are added to the dictionary final_return. total users is the continuationof the previous code snippet.

Python


And here would be the ouput (truncated).

JSON