Table of contents

对 Graph API 中的实体和操作进行寻址Addressing Entities and Operations in the Graph API

Jimaco Brannian|上次更新日期: 2018/6/19
|
2 参与人员

本主题讨论在执行以下操作时使用的各种寻址替代方法:对目录实体进行寻址、调用目录函数、针对目录执行查询或使用 Azure AD Graph API 对目录实体和资源集执行操作。This topic discusses different addressing alternatives that you can use when addressing directory entities, calling directory functions, performing queries against the directory, or performing operations on directory entities and resource sets using Azure AD Graph API.有关执行特定操作或查询、对目录实体进行寻址或调用函数的更多详细信息,请参阅 Azure AD Graph API 参考文档中的相应操作主题。For more detailed information about performing specific operations or queries, addressing directory entities, or calling functions, see the appropriate operations topic in the Azure AD Graph API reference documentation.

重要事项

强烈建议使用 Microsoft Graph 代替 Azure AD Graph API 来访问 Azure Active Directory 资源。We strongly recommend that you use Microsoft Graph instead of Azure AD Graph API to access Azure Active Directory resources.现在我们的开发工作将重点集中在 Microsoft Graph 上,没有计划对 Azure AD Graph API 进行进一步的改进。Our development efforts are now concentrated on Microsoft Graph and no further enhancements are planned for Azure AD Graph API.Azure AD Graph API 仍适用的方案数量非常有限;有关详细信息,请参阅 Office 开发人员中心中的博客文章 Microsoft Graph 或 Azure AD GraphThere are a very limited number of scenarios for which Azure AD Graph API might still be appropriate; for more information, see the Microsoft Graph or the Azure AD Graph blog post in the Office Dev Center.

租户寻址Tenant Addressing

可以使用以下三种方式之一对租户寻址:You can address your tenant in one of three ways:

  • 通过租户对象 IDBy tenant object ID.这是创建租户时分配的 GUID。This is a GUID that was assigned when the tenant was created.它等效于 TenantDetail 对象的 objectId 属性。It is equivalent to the objectId property of the TenantDetail object.以下 URL 显示如何使用对象 ID 对租户目录的顶层资源进行寻址:https://graph.windows.net/12345678-9abc-def0-1234-56789abcde/?api-version=1.6The following URL shows how to address the top-level resources of a tenant’s directory by using the object ID: https://graph.windows.net/12345678-9abc-def0-1234-56789abcde/?api-version=1.6.

  • 通过已验证(注册)的域名By verified (registered) domain name.这是为租户注册的域名之一。This is one of the domain names that are registered for the tenant.它们可在 TenantDetail 对象的 verifiedDomains 属性中找到。These can be found in the verifiedDomains property of the TenantDetail object.以下 URL 显示如何对域为 contoso.com 的租户的顶层资源进行寻址:https://graph.windows.net/contoso.com/?api-version=1.6The following URL shows how to address the top-level resources of a tenant that has the domain contoso.com: https://graph.windows.net/contoso.com/?api-version=1.6.

  • 通过使用“MyOrganization”别名By using the “MyOrganization” alias.仅当使用 OAuth 授权代码授予类型(3 重)身份验证时,此别名才可用。This alias is only available when using OAuth Authorization Code Grant type (3-legged) authentication.此别名不区分大小写。The alias is not case sensitive.它将替换 URL 中的对象 ID 或租户域。It replaces the object ID or tenant domain in the URL.使用此别名时,Graph API 将从附加到请求的令牌中提供的声明获取租户。When the alias is used, Graph API derives the tenant from the claims presented in the token attached to the request.以下 URL 显示如何使用此别名对租户的顶层资源进行寻址:https://graph.windows.net/myorganization/?api-version=1.6The following URL shows how to address the top-level resources of a tenant using this alias: https://graph.windows.net/myorganization/?api-version=1.6.

  • 通过使用"Me"别名By using the “Me” alias.仅当使用 OAuth 授权代码授予类型(3 重)身份验证时,此别名才可用。This alias is only available when using OAuth Authorization Code Grant type (3-legged) authentication.此别名不区分大小写。The alias is not case sensitive.它将替换 URL 中的对象 ID 或租户域。It replaces the object ID or tenant domain in the URL.使用此别名时,Graph API 将从附加到请求的令牌中提供的声明获取用户。When the alias is used, Graph API derives the user from the claims presented in the token attached to the request.以下 URL 可用于调用 getMemberGroups 函数,以便返回当前用户的可传递组成员身份:https://graph.windows.net/me/getMemberGroups?api-version=1.6The following URL can be used to call the getMemberGroups function to return the transitive group memberships of the current user: https://graph.windows.net/me/getMemberGroups?api-version=1.6.注意:POST 请求还必须提供请求正文。)(Note: a request body must also be supplied with the POST request.)

另请参阅See Also

Azure AD Graph API 支持的查询、筛选器和分页选项Azure AD Graph API Supported Queries, Filters, and Paging Options

Azure AD Graph REST API 参考Azure AD Graph REST API Reference

© 2018 Microsoft