API does not return all user account through API
iXsystems FreeNAS Certified Server, Dual CPU, 24 bays
Build FreeNAS-11.0-U3 (c5dcf4416)
Platform Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz
2 bonded 10 GiB fiber
Per the API documentation:
Returns a list of all current users.
Using the API call
"curl -X GET -u root:[password went here] http://192.168.10.222/api/v1.0/account/users/"
On our FreeNAS, it returns a JSON record with user data, but it only has 20 entires, and the FreeNAS Web GUI shows 27 user accounts.
(To be specific, it returns 20 accounts with UID's over 1000, and we have 27 accounts with UID's over 1000. It looks like the API call does not return the built-in accounts root, daemon, etc, which is fine with me).
I could not find anything differentiating the returned accounts from those not returned, except for that it returned accounts that were made earlier, and not ones that were made more recently. Still, the more recent accounts have been on the system for weeks or months. All accounts were created through the FreeNAS GUI.
I'm only using this to find the highest used User ID so I can add 1 to it and create new users through the API, but since it only returns the oldest 20 users, I don't have any way to figure out a valid UID to use to create accounts via the API.
#2 Updated by William Grzybowski almost 3 years ago
- Status changed from Unscreened to 15
By default result is limited to 20 users. To increase that you have to use ?limit=XXX
Does that work for you?