简体   繁体   English

如何将用户配置文件从共享点获取到 asp .net 核心应用程序?

[英]How to get user profiles from sharepoint into asp .net core app?

I've built an app through ASP.NET Core, using the Razor Pages approach, but now I need to get the data from the user profiles of a sharepoint page.我已经通过 ASP.NET Core 使用 Razor Pages 方法构建了一个应用程序,但现在我需要从共享点页面的用户配置文件中获取数据。 Actually, I need access to their all their properties.实际上,我需要访问他们的所有属性。

Is there a way to do this?有没有办法做到这一点? Or is the sharepoint page that has to send that data to the app?还是必须将该数据发送到应用程序的共享点页面?

Using webApi SharePoint使用webApi SharePoint

1) Get all properties of current user: 1) 获取当前用户的所有属性:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties

2) Get single property of current user: 2) 获取当前用户的单个属性:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties/PictureUrl

OR或者

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl

3) Get Multiple Properties for the current user: 3) 获取当前用户的多个属性:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl,AccountName

4) Get all properties of Specific User: 4)获取特定用户的所有属性:

For Office 365/SharePoint Online:对于 Office 365/SharePoint Online:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|vardhaman@siteurl.onmicrosoft.com'

For SharePoint 2013 On-Premises:对于本地 SharePoint 2013:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='domain\username'

5) Get Specific UserProfile Property of Specific User: 5) 获取特定用户的特定 UserProfile 属性:

For Office 365/SharePoint Online:对于 Office 365/SharePoint Online:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='LastName')?@v='i:0%23.f|membership|vardhaman@siteurl.onmicrosoft.com'

For SharePoint 2013 On-Premises:对于本地 SharePoint 2013:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='LastName')?@v='domain\username'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM