asaf1
December 21, 2021, 3:26pm
1
Hi.
I couldn’t find how to perform the following queries, maybe someone will have ideas:
get all the users by role (like https://$ {AUTH0_DOMAIN}/api/v2/roles/${roleID}/users), but I want that the users will have all the fields, including metadata, like in the get user by ID.
In continue to #1 , is it possible to query for list of role IDs and not only a single roleID?
query for roles by role name
Thanks,
Asaf
Hi @asaf1 ,
Thanks for reaching out to the Auth0 Community!
asaf1:
get all the users by role (like https://$ {AUTH0_DOMAIN}/api/v2/roles/${roleID}/users), but I want that the users will have all the fields, including metadata, like in the get user by ID.
To accomplish this, you will need to use the Management API v2 Get a role’s users endpoint in conjunction with the Get users by ID endpoint .
After querying the list of user_id
’s associated with a role, you can pass user_id
to get the user profile.
Unfortunately, it’s not possible to use the Get a role’s users endpoint for more than one role.
However, you could get the use the Get roles endpoint and iteratively pass the Role ID to the Get a role’s users endpoint .
Unfortunately, this is not possible. You must query by Role ID.
I hope this answers your questions.
Please let me know if you have any other questions or concerns. I’d be happy to help.
Thank you.
asaf1
December 22, 2021, 8:17am
4
Thanks a lot.
So apparently I use that API as expected, and no shortcuts there…
1 Like
system
Closed
January 6, 2022, 8:17am
5
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.