Canary API Read Calls
Canary uses .NET APIs to move data between the Views and its own client tools. These same APIs are made public and can be used to create similar data connections to third-party applications.
Documentation for querying data from the Views Service.
API Call Examples
Below are examples of call that can be made using the API. It will be best to install the Chrome extension JSONView for formatting the return.
It is recommended to configure the Views service prior to using these URL examples.
- Open Canary Admin application
- Select Views tile
- Click on 'Configuration' in the bottom tab menu
- Ensure the endpoint 'Http - Anonymous' is enabled and set to port 55235
- Select 'Access' from the side menu
- Add ANONYMOUS LOGON as a user group to the 'ALLOW' window
- Apply changes
/getTimeZones
Provides a list of all available time zones
http://localhost:55235/api/v2/getTimeZones
/getUserToken
Returns a unique user token when security is applied, when connecting anonymously this is not required
http://localhost:55235/api/v2/getUserToken
/browseNodes
Browses nodes on the server and returns all available views.
http://localhost:55235/api/v2/browseNodes
/browseTags
Returns no results because no tags exist at this level
http://localhost:55235/api/v2/browseTags?path=Roadshow%20-%20Water%20District&deep=false
Returns tags found within CanaryWater
http://localhost:55235/api/v2/browseTags?path=Roadshow%20-%20Water%20District.CanaryWater&deep=false
Returns all tags found within CanaryWater.Hays.Station01.Pump01
/getAggregates
Provides a list of all available aggregates and their definition
http://localhost:55235/api/v2/getAggregates
/getQualities
Provides a list of all available quality scores and their corresponding numeric value
http://localhost:55235/api/v2/getQualities?qualities=192&qualities=0&qualities=32768
/getTagProperties
Provides a list of all available properties associated with Hays.Station01.Pump01.Flow
/getTagData
Returns last value of included tag
Returns last value of included tags
Returns raw data values of included tag for past 5 minutes
Returns 5m aggregated data (TimeAverage2) for the past entire hour
/getVirtualViews
Returns a list of all Virtual Views on the server
http://localhost:55235/api/v2/getVirtualViews
/getAssetTypes
Returns all available asset types within the Roadshow - Water District view
http://localhost:55235/api/v2/getAssetTypes?view=Roadshow%20-%20Water%20District
/getAssetTypeTags
Provides a list of the available asset tags found in the Pump asset type
http://localhost:55235/api/v2/getAssetTypeTags?view=Roadshow%20-%20Water%20District&assetType=Pump
/getAssetInstances
Returns a list of asset instances for the Pump asset type
http://localhost:55235/api/v2/getAssetInstances?view=Roadshow%20-%20Water%20District&assetType=Pump
Returns a list of asset instances for the Pump asset type filtered by the ones where Flow < 6500
Returns a list of asset instances for the Pump asset type filtered by the ones that have State=1 & Flow > 6500
You may also visit Canary's GitHub for more examples.
A demonstration of these APIs can be seen in the following video.