bn.la
December 12, 2022, 1:56pm
1
Hey
I’m trying to fetch all users that have specific org id.
String query = "organization_id:\"" + organizationId + "\"";
Request<UsersPage> usersPageRequest = managementAPI.users().list(new UserFilter().withQuery(query));
But I get that can’t filter by ‘organization_id’ error:
! com.auth0.exception.APIException: Request failed with status code 400: Invalid query: filter can not be used with unknown field 'organization_id'
How can I get that info with Java’s SDK ?
Thanks!
Ben
Hi @bn.la ,
Welcome to the Auth0 Community!
You’re looking for the Retrieve Organization Members endpoint.
Here is the reference for the Java SDK: OrganizationsEntity (auth0 1.44.1 API)
1 Like
bn.la
December 14, 2022, 6:06am
4
Great! I wasn’t aware about the semantic difference between users and members and now it’s clear.
Thanks!
1 Like
Perfect! Let us know if you have any other questions.
bn.la
December 19, 2022, 10:32am
6
Hi @dan.woda ,
Actually now when talking to my staff, I need User
fields such as lastLogin
, etc. that are entities of the User
class and not Member
class. Is there any way to fetch Users by organization or that I need to write an algorithm to covert member to user by the user_id
fields they both share?
You can get a list of members from the /api/v2/organizations/{id}/members endpoint, then get individual user details from the /api/v2/users/{id} endpoint.
system
Closed
January 10, 2023, 3:05pm
8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.