有没有一种方法可以使用 Microsoft Graph REST API 调用获取最近更新的设备和用户?

问题描述 投票:0回答:1

我正在尝试通过 MS Graph REST API 调用获取新创建或最近修改的用户和设备的列表。 返回的数据不包含任何可用于将这些条件添加到 API 调用的数据。

我可以使用另一种方法从 API 调用中获取此列表吗?

我正在使用以下 MS Graph REST API 查询:

列出所有设备 https://graph.microsoft.com/beta/devices

https://learn.microsoft.com/en-us/graph/api/device-list?view=graph-rest-1.0&tabs=http

返回示例

{
  "value": [
    {
      "accountEnabled":true,
      "deviceId":"00000000-0000-0000-0000-000000000000",
      "deviceVersion":1,
      "displayName":"contoso_Android",
      "Manufacturer":"Google",
      "Model":"Pixel 3a",
      "operatingSystemVersion":"10.0"
    }
  ]
}

列出所有用户 https://graph.microsoft.com/v1.0/users

https://learn.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http

返回示例

{
    "value": [
        {
            "businessPhones": [],
            "displayName": "Conf Room Adams",
            "givenName": null,
            "jobTitle": null,
            "mail": "[email protected]",
            "mobilePhone": null,
            "officeLocation": null,
            "preferredLanguage": null,
            "surname": null,
            "userPrincipalName": "[email protected]",
            "id": "6ea91a8d-e32e-41a1-b7bd-d2d185eed0e0"
        }
    ]
}
rest microsoft-graph-api data-manipulation data-engineering
1个回答
0
投票

简而言之,对于

users
,您可以使用 subscriptions 来获取关于
users
集合中的更改的通知。

对于

users
devices
,您可以使用 delta 查询来跟踪更改。

https://learn.microsoft.com/en-us/graph/api/user-delta?view=graph-rest-1.0&tabs=http

https://learn.microsoft.com/en-us/graph/api/device-delta?view=graph-rest-1.0&tabs=http

© www.soinside.com 2019 - 2024. All rights reserved.