1

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.

  1. Open Canary Admin application
  2. Select Views tile
  3. Click on 'Configuration' in the bottom tab menu
  4. Ensure the endpoint 'Http - Anonymous' is enabled and set to port 55235
  5. Select 'Access' from the side menu
  6. Add ANONYMOUS LOGON as a user group to the 'ALLOW' window
  7. 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

http://localhost:55235/api/v2/browseTags?path=Roadshow%20-%20Water%20District.CanaryWater.Hays.Station01.Pump01&deep=false

/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

http://localhost:55235/api/v2/getTagProperties?tags=Roadshow%20-%20Water%20District.CanaryWater.Hays.Station01.Pump01.Flow

/getTagData

Returns last value of included tag

http://localhost:55235/api/v2/getTagData?tags=Roadshow%20-%20Water%20District.CanaryWater.Hays.Station01.Pump01.Flow

Returns last value of included tags

http://localhost:55235/api/v2/getTagData?tags=Roadshow%20-%20Water%20District.CanaryWater.Hays.Station01.Pump01.Flow&tags=Roadshow%20-%20Water%20District.CanaryWater.Hays.Station01.Pump02.Flow

Returns raw data values of included tag for past 5 minutes

http://localhost:55235/api/v2/getTagData?tags=Roadshow%20-%20Water%20District.CanaryWater.Hays.Station01.Pump01.Flow&startTime=now-5m&endTime=now

Returns 5m aggregated data (TimeAverage2) for the past entire hour

http://localhost:55235/api/v2/getTagData?tags=Roadshow%20-%20Water%20District.CanaryWater.Hays.Station01.Pump01.Flow&startTime=hour-1h&endTime=hour&aggregateName=TimeAverage2&aggregateInterval=5m

/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

http://localhost:55235/api/v2/getAssetInstances?view=Roadshow%20-%20Water%20District&assetType=Pump&filterExpression=%22[Flow]%3C6500%22

Returns a list of asset instances for the Pump asset type filtered by the ones that have State=1 & Flow > 6500

http://localhost:55235/api/v2/getAssetInstances?view=Roadshow%20-%20Water%20District&assetType=Pump&filterExpression=%22[State]%3D1%20%26%26%20[Flow]%20%3E%206500%22


You may also visit Canary's GitHub for more examples.

A demonstration of these APIs can be seen in the following video.

Reply

null