IoT Central Device List ODATA filter sample ?

Kevin BEAUGRAND (MVP) 26 Reputation points MVP
2021-11-26T06:21:20.643+00:00

Hi,

I'm trying using IoT Central REST APIs to query my devices.
I saw that recently it was released a preview that enable the possibility to use ODATA filter on device list.

https://learn.microsoft.com/en-us/rest/api/iotcentral/1.1-previewdataplane/devices/list

Do this API gives the possibility fo filter accross the device properties (it seems not r my query is false).

Example:

   curl --location --request GET 'https://gddp-iotcentral.azureiotcentral.com/api/devices/?api-version=1.1-preview&$filter=properties.DevAddr eq "02AB4A2B"' \  
   \--header 'Authorization: omitted for security'  

My device has a property DevAddr taht could be get by /device/<id>/properties..

Regards,

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
359 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dom 1,631 Reputation points Microsoft Employee
    2022-09-14T16:38:00.95+00:00

    @Kevin BEAUGRAND (MVP) - As an alternative to using ODATA filters with the device list API, there's also a device query API that does let you filter by property values.

    For more details, take a look at https://learn.microsoft.com/azure/iot-central/core/howto-query-with-rest-api#value-comparisons

    0 comments No comments