0

I want to create 2 usergroups in one cognito user pool. One user group will have admin info and login credentials and other will have a normal user login credentials and a few extra custom attributes. I have added users to the user pool in cognito. Now I want to create a web app using ReactJs where the admin logs in and he can see a list of users entered in cognito and also the custom attributes of users in usergroup of normal users. I found ListUsers API but can't figure out how to use it

Naresh
  • 11
  • 3

1 Answers1

0

It does not appear like the ListUsers API lets you filter on group membership therefore you cannot ask it to list admin users for e.g.

The ListUsers API lets you retrieve specific user attributes (name, email) for users within a User Pool specified by its ID, and also lets you filter by user attributes (name=..., email=..., status = disabled)

The API that you should be looking at instead is actually ListUsersInGroup, it will let you list the users where GroupName="admin" for example.

mipnw
  • 2,135
  • 2
  • 20
  • 46
  • thanks for pointing me to the right API but another part of my question is how do I use that API in reactJs and display the details of all the users in that group @mipnw – Naresh Apr 06 '18 at 06:01