Search code examples
cumulocity

OData-style querying in Cumulocity


I wanted to send an OData Query to Cumulocity. I got some documents pointing to the special format of query in the platform:

...&q=$filter%3D(c8y_Availability.status+eq+%27AVAILABLE%27)

By the way it is not working (for the list of alarms). Do you support OData-query? Can you provide me a sample for OData querying in cumulocity?


Solution

  • Have a look here: http://cumulocity.com/guides/reference/inventory/#query-language

    There are examples at the bottom of the section.

    Hint: You can also peek into Chrome Developer Tools while editing the filters of the device list in the device management application. Your above example looks like this in the developer tools:

    https://demos.cumulocity.com/inventory/managedObjects?currentPage=1&pageSize=100&q=$filter%3D(c8y_Availability.status+eq+%27AVAILABLE%27)&withGroups=true&withTotalPages=true

    ... and this looks quite much like the example you had above.