Custom query URLs
Asset-centric OData service example
To filter on a resource type property:{resourceType}: a resource type, such as Assets, TimeSeries, Events, etc.{Filter}: the OData filter expression.
Data-modeling OData service example
To filter on a view property in a data model:{view}: the name of the view in your data model.{Filter}: the OData filter expression.
Custom query examples
Simple equality filter
An equality filter uses the formatAttributeName eq 'AttributeValue':
Data modeling filtering
A filter applied directly to a property of a data model view:Metadata filtering
For metadata, filtering is performed on properties nested inside the metadata object:Combined filter
Using functions in filters
OData supports functions likestartswith, endswith, and contains.
For example, to filter time series where ExternalId starts with 'Sensor':
Combining multiple query parameters
You can combine multiple query options to refine your data retrieval. For example, to retrieve assets whereName starts with 'Pump', select only Id and Name, and order by Name:
Debugging custom queries
- Use separate tools: Tools like Fiddler allow you to inspect the HTTP traffic between your client and the server.
- Check the filter syntax: Ensure that your filters are correctly formatted according to the OData specification.
- Review supported filters: See Filter items in data models and Filtering asset-centric resource types to learn about the filtering capabilities supported by the OData services.