C# 如何将用户配置文件从sharepoint获取到asp.net核心应用程序?

C# 如何将用户配置文件从sharepoint获取到asp.net核心应用程序?,c#,asp.net-core,web,sharepoint,razor-pages,C#,Asp.net Core,Web,Sharepoint,Razor Pages,我已经使用Razor Pages方法通过ASP.NET Core构建了一个应用程序,但现在我需要从sharepoint页面的用户配置文件中获取数据。事实上,我需要访问他们所有的财产 有办法做到这一点吗?或者sharepoint页面必须将该数据发送到应用程序 使用 1获取当前用户的所有属性: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties http://siteurl/_api/SP.UserProfiles.P

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

有办法做到这一点吗?或者sharepoint页面必须将该数据发送到应用程序

使用

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

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties/PictureUrl
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl,AccountName
2获取当前用户的单个属性:

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

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

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties/PictureUrl
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'
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/GetPropertiesFor(accountName=@v)?@v='domain\username'
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='LastName')?@v='domain\username'
5获取特定用户的特定UserProfile属性:

对于Office 365/SharePoint Online:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|vardhaman@siteurl.onmicrosoft.com'
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/GetPropertiesFor(accountName=@v)?@v='domain\username'
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='LastName')?@v='domain\username'