Filtering on @odata.type via Microsoft Graph API

This is a knowledgebase item. Hope it helps you out someday.

To get a subset of the results from the Graph API, we can use the filter command. Which is explained here.

Filtering Error on @odata.type via Graph API

Filtering works fine for almost all properties, but if you want to filter by the @odata.type, for example, it’s just a little bit different.

Solution

https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations?$filter=(isof('{odata type}'))

For e.g.,

https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations?$filter=(isof('microsoft.graph.windows10CustomConfiguration'))

Results:

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.