Is there a way to search for a user by name and/or email address via the python library?
I need to do this because when adding users to a project via the web site I get duplicate names and don't know which user to choose. If I could see the email address that would be very helpful. In the meantime I'm trying to build my own user search tool so I know I'm choosing the correct user to share with.
Created by Patrick Stout pstout Thanks for the info. That is good to know how the teams work with emails (I am using teams).
I did throw together some Python code that will find users and print their info (minus email) in anyone stumbles upon this looking for similar information.
```
# Complete script at: https://gist.github.com/pcstout/e103264e70a8fb1067302f3655808c58
...
results = self._synapse_client._findPrincipals(self._query)
for result in results:
user_profile = self._synapse_client.getUserProfile(result.userName)
print('{0} {1}'.format(user_profile.firstName, user_profile.lastName))
self._synapse_client.printEntity(user_profile)
```
Hello Patrick!
Synapse doesn't allow searching for users by email address, but you CAN send team invitations by email address -- if you are sharing your project with a group of people consistently, you can make a TEAM to leverage group permissions in Synapse instead, and share the project with the team, if you want.
Then, when you invite folks to join your project-access team, you can invite them w/ email address -- if the user already has a Synapse account, the invitation will be routed to the correct user name (allowing you to disambiguate confusingly similar user names) and if the user does NOT already have a Synapse account, an invitation to join will be created and sent to the user, along with the invite to join your team.
This functionality currently exists in the web UI only. When you click on "Invite User", you can either enter a Synapse user name OR a user's email address. And we have not yet added this functionality directly to the project sharing settings modal, only to teams -- if it would be useful to add this to project/file sharing settings as well, we can consider adding it to our roadmap for future development.
Let me know if you have any other questions!
Best,
Meredith
Drop files to upload
How to query users via the Python library? page is loading…