简体   繁体   English

在具有多个属性的Graph API查询中使用$ expand?

[英]Using $expand in Graph API query with multiple attributes?

Is it possible to $expand multiple attributes. 是否可以扩展多个属性。 For example: 例如:

https://graph.microsoft.com/beta/me ?$expand=memberOf,manager https://graph.microsoft.com/beta/me?$ expand = memberOf,manager

This will result in an error. 这将导致错误。

The result of parsing $expand contained at least 2 items, but the maximum allowed is 1. 解析$ expand的结果至少包含2个项目,但允许的最大值为1。

Please refer to document($expand section) : 请参考文档($ expand部分):

https://developer.microsoft.com/en-us/graph/docs/overview/query_parameters https://developer.microsoft.com/en-us/graph/docs/overview/query_parameters

If you query on the user resource, you can use $expand to get the properties of only one child object or collection at a time. 如果查询用户资源,则可以使用$ expand一次仅获取一个子对象或集合的属性。

And here is a discussion about same topic : 是关于同一主题的讨论:

However, specific entities may still have limits and for users it is still limited to a single expanded navigation. 但是,特定实体可能仍然有限制,并且对于用户而言,它仍然仅限于单个展开的导航。 That is not expected to change. 预计这种情况不会改变。

EDIT: I know this is quite an old question, but for anyone ending here in the future: 编辑:我知道这是一个很老的问题,但对于将来在这里结束的任何人:

It is possible (in some cases) with the following syntax: 使用以下语法是可能的(在某些情况下):

$expand=relation1($select=id,name),relation2($expand=relation2a($select=id))

It is difficult to determine where expands will work since the documentation is quite evasive, but I have made the above work successfully. 由于文档很容易规避,因此很难确定扩展将在哪里工作,但是我已经成功完成了上述工作。 Perhaps the missing piece for your case is to specify the inner query paremeters in your expands? 也许您遇到的情况缺少的部分是在扩展中指定内部查询参数?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用图形API从AD读取自定义属性 - Read custom attributes from AD using graph API 使用Graph API目录架构API创建时未显示B2C自定义属性 - B2C Custom Attributes not showing when created using Graph API directory schema API 在 Python 中使用 Azure 图形 API 使用基于过滤器的查询参数 - Using Filter based query parameters using Azure Graph API in Python 如何使用 Microsoft Graph api 从 azure 活动目录中获取所有用户属性 - How to get all user attributes from azure active directory using Microsoft Graph api Microsoft Graph OData查询参数$ expand似乎不起作用 - Microsoft Graph OData query parameter $expand doesn't seem to work Gremlin Graph API查询记录 - Gremlin Graph API query logging Microsoft Graph API 尝试使用 $expand(microsoft.graph.itemattachment/item) 读取 ItemAttachment 属性时“访问被拒绝” - Microsoft Graph API “Access is denied” while trying to read the ItemAttachment Properties with $expand(microsoft.graph.itemattachment/item) 如何查询 Sharepoint REST api (不是图形 api) 使用 Z3A580F1422038F1422038673F1 注册应用程序? - How to query the Sharepoint REST api (not the Graph api) using an Azure AD registered application? 使用图形读取 Azure B2C 自定义属性 API - Reading Azure B2C custom attributes with Graph API 无法从/ users / {oid}图形API读取用户自定义属性 - unable to read user custom attributes from /users/{oid} graph api
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM