gpt4 book ai didi

microsoft-graph-api - 使用Microsoft Graph在用户上获取扩展属性

转载 作者:行者123 更新时间:2023-12-03 13:32:05 25 4
gpt4 key购买 nike

我正在使用Microsoft Graph来管理Azure AD用户,并且在访问User对象上的扩展属性时遇到了一些麻烦。使用Azure AD Graph API创建用户时添加了该属性,并且如果使用Azure AD API查询用户,则扩展属性将自动返回,名称为“extension_ {appId} _ {propertyName}”。我想使用Microsoft Graph访问此属性的值,但没有找到正确的调用。

我尝试使用$ select直接选择属性(通过上面列出的全名)和简称。
https://graph.microsoft.com/beta/Users/{id}?$select=extension_{appId}_{propertyName}

我也尝试使用$ expand查询singleValueExtendedProperty(和multiValue),但被告知该属性在User对象上不存在。
https://graph.microsoft.com/beta/Users/{id}?$expand=singleValueExtendedProperty

我还使用了User对象上的“扩展”字段,但始终始终为null。

只是好奇Graph是否支持此操作,如果支持,如何查询该字段。如果在查询用户组而不必运行单独的查询时可以得到此扩展的值,那将是一个好处。

最佳答案

扩展名显示在Extensions集合内的Microsoft Graph中,不是顶级属性:

"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,displayName,mail,extensions)/$entity",
"id": "16f5a7b6-5a15-4568-aa5a-31bb117e9967",
"displayName": "Anne Weiler",
"mail": "annew@CIE493742.onmicrosoft.com",
"extensions@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('16f5a7b6-5a15-4568-aa5a-31bb117e9967')/extensions",
"extensions": [
{
"@odata.type": "#microsoft.graph.openTypeExtension",
"theme": "dark",
"color": "purple",
"lang": "Japanese",
"extensionName": "com.contoso.roamingSettings",
"id": "com.contoso.roamingSettings"
}
]
例如,您可以使用以下查询返回 users(包括任何扩展名)的集合: v1.0/users?$select=id,displayName,mail&$expand=extensions(请参见 Graph Explorer中的内容)

关于microsoft-graph-api - 使用Microsoft Graph在用户上获取扩展属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45925030/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com