如何使用 REST API(MS GRAPH 或 WEB API)区分完整用户和团队成员?

How to differentiate Full Users and Team Members using REST API (MS GRAPH or WEB API)?

我需要弄清楚哪个用户是 "Full User" 或 "Team Member"。在文档中找不到任何信息。有人可以帮助我吗?

看看Microsoft Graph REST API

您可以调用 users 方法来获取用户列表。

请求

GET https://graph.microsoft.com/v1.0/users

回应

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

{
  "value": [
    {
      "businessPhones": [
        "businessPhones-value"
      ],
      "displayName": "displayName-value",
      "givenName": "givenName-value",
      "jobTitle": "jobTitle-value",
      "mail": "mail-value",
      "mobilePhone": "mobilePhone-value",
      "officeLocation": "officeLocation-value",
      "preferredLanguage": "preferredLanguage-value",
      "surname": "surname-value",
      "userPrincipalName": "userPrincipalName-value",
      "id": "id-value"
    }
  ]
}

然后您可以遍历用户列表并使用 licenseDetails 方法获取他们的每个许可证详细信息。

请求

GET https://graph.microsoft.com/v1.0/{userid}/licenseDetails

回应

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

{
  "value": [
    {
      "servicePlans": [
        {
          "servicePlanId": "servicePlanId-value",
          "servicePlanName": "servicePlanName-value",
          "provisioningStatus": "provisioningStatus-value",
          "appliesTo": "appliesTo-value"
        }
      ],
      "skuId": "skuId-value",
      "skuPartNumber": "skuPartNumber-value",
      "id": "id-value"
    }
  ]
}