使用 Microsoft Graph 查询全局地址列表 [英] Querying Global Address List with Microsoft Graph

查看:33
本文介绍了使用 Microsoft Graph 查询全局地址列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Microsoft Graph 查询全局地址列表.我已经使用并改编了来自 https://github.com 的示例代码/microsoftgraph/console-csharp-snippets-sample.git -- 但是,我仍然遇到问题.我看过这篇文章 -- Global Address List Graph API -- 这表明我需要使用/contacts"端点.但是,当我使用 Microsoft.Graph 库时,我看不出这对我有什么帮助.Microsoft.Graph 库中是否有一些方法或集合可以让我读取 GAL?

I'm trying to query the Global Address List using Microsoft Graph. I've worked with and adapted the sample code from https://github.com/microsoftgraph/console-csharp-snippets-sample.git -- however, I'm still having trouble. I've seen this article -- Global Address List Graph API -- which indicates I need to use the "/contacts" endpoint. However, I don't see how this helps me when I'm using the Microsoft.Graph library. Is there some method or collection within the Microsoft.Graph library that will allow me to read the GAL?

推荐答案

GAL"是一个 MAPI 概念,并不真正适用于 Graph.使用 Graph,您只需读取公司 Active Directory 中的用户或联系人.通过组合这两个列表,您将接近您在 MAPI 客户端的 GAL 中看到的内容.

"GAL" is a MAPI concept that doesn't really apply to Graph. With Graph, you just read the users or contacts in your company's Active Directory. By combining both lists, you come close to what you'd see in the GAL in a MAPI client.

要做到这一点,您可以在此处将用户列为文档:https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list

To do that, you would list users as doc'ed here: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list

使用图书馆,我相信这会让你开始:

Using the library, I believe this will get you started:

client.Users.Request().GetAsync();

对于联系人,Graph 库要复杂得多.组织联系人仅在 Microsoft Graph 的 Beta 版中受支持,遗憾的是客户端库不支持该版本.(有关信息,请参阅此问题).Michael Mainer 写了一篇写了如何生成自己的库的测试版 如果你有兴趣.

For contacts, it's a lot trickier with the Graph library. Organizational contacts are only supported in the beta version of Microsoft Graph, which the client library doesn't support unfortunately. (See this issue for info). Michael Mainer did a write up of how you can generate your own beta version of the library if you're interested.

有关查询组织联系人的信息可在此处找到:https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/orgcontact.

The info on querying organizational contacts is found here: https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/orgcontact.

这篇关于使用 Microsoft Graph 查询全局地址列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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