问题
is there any API in VSTS that's equivalent to IIdentityManagementService2 in TFS? I used ReadIdentity(https://msdn.microsoft.com/en-us/library/ff731745(v=vs.120).aspx) to get the email address and display name of an account alias in TFS. I am trying to do the same in VSTS, but I am not finding anything that can do similar things in its REST API or Microsoft.VisualStudio.Services.* libraries.
回答1:
Yes, you can get it via Accounts and profiles in VSTS Rest API, the "Accounts" can get the accounts in the collection and the "Profiles" can get the information like Display Name, Email address for the member.
One thing you need to notice is that, to call "Accounts and profiles" API, you must use OAuth2.0 authentication.
Q: Can I use basic auth with the profiles API?
A: No, you must use OAuth.
来源:https://stackoverflow.com/questions/39155773/get-email-and-display-name-from-alias-in-visual-studio-team-services