Graph API supports filter on all data fields
Graph API supports filter. But when try to filter on the wiFiMacAddress when query managedDevices on Intune by property ‘wiFiMacAddress' like
https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$filter=startswith(wiFiMacAddress, 'macAddressValue’), or
https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$filter=wiFiMacAddress eq 'macAddressValue’,
It returns all managed devices, i.e., the filter doesn’t work. Filtering on other data properties/fields such as 'deviceName' or 'lastSyncDateTime', it works as expected.
It will be nice if Graph API can support filtering on all data properties/fields, or at least document which fields work and which don't.
Dilip Kulkarni commented
I am having issue filtering noncompliant devcies using "https://graph.microsoft.com/v1.0/devicemanagement/managedDevices?$filter=state eq 'nonCompliant'"
the query returns all the managed devices.
Dave Randall - Intune Product Team commented
Thanks for the feedback. Through our API review process, we've have guidance for teams to annotate their property descriptions with which ODATA query parameters are supported. We have more work to do to get these updated. It's not likely that all properties will support filtering - but I agree, we do need to get properties updated with better descriptions. We'll start with /managedDevices - I know that's a key API.
Please fix this, consistency is so important.
At https://docs.microsoft.com/en-us/graph/api/intune-devices-manageddevice-get?view=graph-rest-1.0, the documentation says : "This method supports the OData Query Parameters to help customize the response."
When trying, the only odata filter that worked for me is : https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$select=wiFiMacAddress. Not very useful to perform a query.
But I don't know if that is the right place to post this. Maybe would be smarter in the GraphAPI Uservoice : https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/category/101632-microsoft-graph-o365-rest-apis