使用 MS 图形 API 获取 SP 站点的 SharePoint 用户 ID 和配置文件 [英] Get SharePoint user ID and profile of an SP site with MS graph api

查看:53
本文介绍了使用 MS 图形 API 获取 SP 站点的 SharePoint 用户 ID 和配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用 Microsoft Graph API 在 SharePoint 网站中获取用户 ID?

Is there a way to get user ID inside a SharePoint site with Microsoft Graph API ?

我通过/me 端点获得了 guid id,但在我的 SP 站点中,当前用户的 id 为 033.

I get a guid id with /me endpoint but in my SP site the current user has id 033.

我知道有一种方法可以使用带有 currentspcontext 的 SP rest api.但我想用ms图查询

I know there is a way with SP rest api with currentspcontext. But i want to query with ms graph

推荐答案

我相信 Microsoft Graph 当前仅允许您查询 SharePoint 网站、列表和列表项.您是否尝试过使用 Microsoft Graph 查询用户信息列表?

I believe the Microsoft Graph currently only lets you query SharePoint sites, lists, and list items. Have you tried using the Microsoft Graph to query the User Information list?

这是您需要的服务呼叫示例.您需要提供用户信息列表的 guid 和用户的显示名称.//graph.microsoft.com/v1.0/sites/root/lists/{user info list guid}/items?$select=Fields&$filter=Fields/Title eq 'Alex Wilber'&$expand=Fields

Here is a sample of the service call that you need. You'll need to provide your user information list's guid and the Display name of the user. //graph.microsoft.com/v1.0/sites/root/lists/{user info list guid}/items?$select=Fields&$filter=Fields/Title eq 'Alex Wilber'&$expand=Fields

这篇关于使用 MS 图形 API 获取 SP 站点的 SharePoint 用户 ID 和配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆