获取组织

命名空间:microsoft.graph

重要

Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

获取当前经过身份验证的组织的属性和关系。

由于 organization 资源支持扩展,因此也可使用 GET 操作获取 organization 实例中的自定义属性和扩展数据。

此 API 可用于以下国家级云部署

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国

权限

要调用此 API,需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限

权限类型 权限(从最低特权到最高特权)
委派(工作或学校帐户) User.Read、Organization.Read.All、Directory.Read.All、Organization.ReadWrite.All、Directory.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。
应用程序 Organization.Read.All、Directory.Read.All、Organization.ReadWrite.All、Directory.ReadWrite.All

对于委托方案,已登录用户必须至少具有以下Microsoft Entra角色之一。

  • AdHoc 许可证管理员
  • 应用程序管理员
  • 身份验证管理员
  • Azure 信息保护管理员
  • Azure 信息保护管理员
  • 帐务管理员
  • 云应用程序管理员
  • 合规数据管理员
  • 客户密码箱访问审批者
  • 客户密码箱访问审批者
  • 桌面分析管理员
  • 目录读取器
  • 目录审阅者
  • 目录作者
  • Dynamics 365管理员
  • Dynamics 365管理员
  • 全局读取者
  • 来宾用户
  • 帮助台管理员
  • Insights 管理员
  • Kaizala 管理员
  • 许可证管理员
  • 邮箱管理员
  • Microsoft 托管桌面管理员
  • 适用于企业的 Microsoft Store用户
  • 新式商务管理员
  • Power BI 管理员
  • Power BI 管理员
  • 特权身份验证管理员
  • 特权角色管理员
  • 受限来宾用户
  • 安全管理员
  • 安全操作员
  • 安全信息读取者
  • 服务支持管理员
  • Teams 管理员
  • Teams 通信管理员
  • Teams 通信支持工程师
  • Teams 通信支持专家
  • 用户
  • 用户管理员
  • 批量许可业务中心用户
  • 批量许可服务中心用户

授予 User.Read 权限的应用程序只能读取组织的 iddisplayNameverifiedDomains 属性。 所有其他属性返回值 null 。 若要读取所有属性,请至少使用 Organization.Read.All

HTTP 请求

GET /organization/{organizationId}

可选的查询参数

此方法仅$select支持 OData 查询参数,以帮助自定义响应。

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权

请求正文

请勿提供此方法的请求正文。

响应

如果成功,此方法在响应正文中返回 200 OK 响应代码和一个组织对象的集合。

示例

请求

以下示例显示了一个请求。

GET https://graph.microsoft.com/beta/organization/84841066-274d-4ec0-a5c1-276be684bdd3
响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#organization/$entity",
    "id": "84841066-274d-4ec0-a5c1-276be684bdd3",
    "deletedDateTime": null,
    "businessPhones": [
        "425-555-0100"
    ],
    "city": null,
    "country": null,
    "countryLetterCode": "NL",
    "createdDateTime": "2021-08-02T10:30:06Z",
    "defaultUsageLocation": "String",
    "displayName": "Contoso",
    "isMultipleDataLocationsForServicesEnabled": null,
    "marketingNotificationEmails": [],
    "onPremisesLastPasswordSyncDateTime": "2021-08-02T10:30:06Z",
    "onPremisesLastSyncDateTime": null,
    "onPremisesSyncEnabled": null,
    "partnerTenantType": "ResellerPartnerDelegatedAdmin",
    "postalCode": null,
    "preferredLanguage": "en",
    "securityComplianceNotificationMails": [],
    "securityComplianceNotificationPhones": [],
    "state": null,
    "street": null,
    "technicalNotificationMails": [
        "admin@contoso.com"
    ],
    "tenantType": "AAD",
    "directorySizeQuota": {
        "used": 698,
        "total": 50000
    },
    "assignedPlans": [
        {
            "assignedDateTime": "2022-04-03T02:46:42Z",
            "capabilityStatus": "Deleted",
            "service": "Adallom",
            "servicePlanId": "932ad362-64a8-4783-9106-97849a1a30b9"
        },
        {
            "assignedDateTime": "2022-04-03T02:46:42Z",
            "capabilityStatus": "Deleted",
            "service": "MultiFactorService",
            "servicePlanId": "8a256a2b-b617-496d-b51b-e76466e88db0"
        },
        {
            "assignedDateTime": "2021-08-02T10:36:57Z",
            "capabilityStatus": "Enabled",
            "service": "exchange",
            "servicePlanId": "113feb6c-3fe4-4440-bddc-54d774bf0318"
        },
        {
            "assignedDateTime": "2021-08-02T10:36:02Z",
            "capabilityStatus": "Deleted",
            "service": "SCO",
            "servicePlanId": "882e1d05-acd1-4ccb-8708-6ee03664b117"
        }
    ],
    "privacyProfile": {
        "contactEmail": "",
        "statementUrl": ""
    },
    "provisionedPlans": [
        {
            "capabilityStatus": "Deleted",
            "provisioningStatus": "Success",
            "service": "Adallom"
        },
        {
            "capabilityStatus": "Enabled",
            "provisioningStatus": "Success",
            "service": "exchange"
        }
    ],
    "verifiedDomains": [
        {
            "capabilities": "Email, OfficeCommunicationsOnline",
            "isDefault": true,
            "isInitial": true,
            "name": "Contoso.com",
            "type": "Managed"
        }
    ]
}