Api list of all users pageSize limit is 500

Enterprise Edition - Version 7.9.3

How can I pull a list of all our users (just names). Ran into pageSize limit of 500. Also, can the output be in a different format as well?

Here is what I’m currently using:
curl -u <token>: https://<website>/api/users/search?pageSize=500

Hi,

Welcome to the community!

First, your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

7.9.3 → 8.9.2 → 9.0.1 (last step optional)

Regarding your actual question, you should be able to pull multiple pages using the p parameter, IIRC. Output format is not modifiable server-side. You’ll need to read it in and output the data in your format of choice.

 
HTH,
Ann

Hi Ann,
Thanks for replying.

Alright, call me slow but I’m just not following here. When I set the ps=50 and the p=2 I should get 100 users back right? However, I’m only getting 50. Also, when it says total 1694 could I assume this is my total number of users? This does correlate with the count from the UI. Still need the list of all users though.

Here is my curl command:

curl -u <token>: 'https://localhost/api/users/search?ps=50&p=2' 

and here is the start of my json file:

{"paging":{"pageIndex":2,"pageSize":50,"total":1694},"users":

What am I doing wrong here?

Hi @fword3 ,

you need to iterate over the pages. think of it like a book where you can define the number of sentences per page. if you define a page size (ps) of 50, you will get 50 entries on one page in return. with this information you can now iterate over the pages. ps=50&p=2 would give you now 50 entries on the second page and so on.

in order to get all users in your instance you could write something like this:

#!/bin/bash

#4*500>1694

TOKEN="your token"

for i in 1 2 3 4;
do
	curl -u "${TOKEN}:" "http://localhost:9000/api/users/search?ps=500&p=$i"
done

hope that helps :slight_smile:

2 Likes

Now there you go Tobias, that’s what I’m talking about and you even provide code. :clap:

Cheers!

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