【问题标题】:Get SharePoint User by Lookup ID using Microsoft Graph使用 Microsoft Graph 按查找 ID 获取 SharePoint 用户
【发布时间】:2021-02-28 04:48:14
【问题描述】:

我在 Microsoft Graph 中执行以下查询:

var results = await SPLists["<my-list-name>"]
                .Items
                .Request()
                .Expand("fields")
                .GetAsync(); 

它获取我在 SharePoint 中的列表项。该列表中的一列属于“个人或组”类型。在 Microsoft Graph 的响应中,它会返回如下所示的列数据(例如):

{
    "LookupId": 335,
    "LookupValue": "John Doe"
}

如何利用这些数据?如何使用 Microsoft Graph 获取 ID 为 355 的人员的完整个人资料?我需要返回人的电子邮件地址。如何使用 Microsoft Graph SDK 获得它?

【问题讨论】:

  • 你试过评论里的建议了吗?成功了吗?

标签: sharepoint microsoft-graph-api sharepoint-list sharepoint-api


【解决方案1】:

Look Id 335 是 SharePoint 隐藏列表中名为“用户信息列表”的 Id,您可以使用请求获取列表 guid:

https://graph.microsoft.com/v1.0/sites/site-id/lists?$filter=DisplayName eq 'User Information List'

然后使用下面端点中的列表 guid 获取详细的电子邮件地址:

https://graph.microsoft.com/v1.0/sites/site-id/lists/UserInformationListId/items/335

这是一个类似的线程供您参考:

How to get user from User field LookupId

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-06-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多