繁体   English   中英

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

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

我已经通过 ASP.NET Core 使用 Razor Pages 方法构建了一个应用程序,但现在我需要从共享点页面的用户配置文件中获取数据。 实际上,我需要访问他们的所有属性。

有没有办法做到这一点? 还是必须将该数据发送到应用程序的共享点页面?

使用webApi SharePoint

1) 获取当前用户的所有属性:

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

2) 获取当前用户的单个属性:

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

或者

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

3) 获取当前用户的多个属性:

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

4)获取特定用户的所有属性:

对于 Office 365/SharePoint Online:

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

对于本地 SharePoint 2013:

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

5) 获取特定用户的特定 UserProfile 属性:

对于 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'

对于本地 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