简体   繁体   中英

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

This will result in an error.

The result of parsing $expand contained at least 2 items, but the maximum allowed is 1.

Please refer to document($expand section) :

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.

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM