首页 文章

Microsoft Graph:OData $ select查询参数未选中

提问于
浏览
0

The MS Graph 'Get a user' documentation说:

如果需要不同的属性集,可以使用OData $ select查询参数

但它似乎无法在我的代码或图形资源管理器中工作 . 在两者中,查询 https://graph.microsoft.com/v1.0/me?$select=displayName 返回 full set 用户属性:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(surname)/$entity",
    "displayName": "<my name>",
    "surname": "<my surname>",
    "givenName": "<my given name>",
    "id": "<my <my ID>>",
    "userPrincipalName": "<my email>",
    "businessPhones": [<my phones>],
    "jobTitle": <my job title>,
    "mail": null,
    "mobilePhone": null,
    "officeLocation": null,
    "preferredLanguage": null
}

如何获得所需的用户属性子集(例如displayName)?

[EDITED]

为了回应Lee_MSFT 's Graph Explorer screenshot below, here',我从完全相同的查询中得到了什么:

......为什么差异?什么与我的查询有关?

2 回答

  • 1

    我猜你正在使用个人Microsoft帐户(有时称为MSA或Outlook.com帐户),而Lee正在使用Office 365帐户 . 我在使用MSA时重现您的行为,但在Office 365中不重现.MSA帐户在Graph中的行为略有不同 . 我将向图表人员报告 .

    与此同时,有什么东西会让你失望吗?我知道你得到的 property 比你想要的多,但至少没有什么遗漏:) .

  • 1

    这是我的测试结果,工作正常 .
    enter image description here

相关问题