如何通过Graph API获取用户登录设备的操作系统?
仅获取登录日志中deviceDetail.operatingSystem字段的Graph API查询方法
要只返回deviceDetail下的operatingSystem字段,你需要在请求URL中使用**$select**查询参数,通过点语法指定嵌套字段:
GET https://graph.microsoft.com/v1.0/auditLogs/signIns?$select=deviceDetail/operatingSystem
返回的数据结构会精简为仅包含你指定的字段:
{ "value": [ { "deviceDetail": { "operatingSystem": "Windows 10" } } ] }
如果还需要同时返回其他顶层字段(比如userPrincipalName),可以用逗号分隔多个字段:
GET https://graph.microsoft.com/v1.0/auditLogs/signIns?$select=userPrincipalName,deviceDetail/operatingSystem
内容的提问来源于stack exchange,提问作者user8080
相关产品推荐
相关产品推荐

