Use Case

This article describes how to use either chrome or IE, or another API tester application to query the aggregate measurements/values associated with domain points in Bazefield. Prior to this, it is suggested to read

Quick Start: Bazefield API

Quick Start: Tag Manager 

Importing Post Man Files

Exercise 1:  Querying API with Chrome and Postman 

Exercise 3:  Querying Time Series Aggregates of Tags


Background

This article reviews how to request aggregate statistics of domain points within defined interval windows supplied by the user.  This includes minimums, maximums, time averages, standard deviations, etc.   This, in principle, is the same as Exercise 3:  Querying Time Series Aggregates of Tags, but instead accesses the data through the "domain point".  The difference between the two can easily be summarized as:


Tag:  Single time series point identified by a tag name (e.g. WFU-T01-WindSpeed)

Domain Point:  Collection of tags or "points" identified by a point name ("WindSpeed")


Prerequisites

Download the Postman file at the bottom of this article and use it according to the guidelines here:

Importing Post Man Files

 

Requests

  • Substitute {{domain}} with user's web domain and {{tag1}}, {{tag2}}, etc with requested tags to query.  
  • Substitude {{aggregate}} with desired aggregate formula (see table 2)
  • Substitude {{intervalSec}} with desired interval length in milliseconds (10 min = 600000)
  • Substitude {{numPoints}} with desired number of intervals within range (e.g. 2 evenly splits the query period into 2 equal windows)


Request

DescriptionURL Example
Last Known Values (domain points)Request to query last known values of domain points

https://{{domain}}.bazefield.com/Bazefield.Services/api/

objects/points?ObjectIds={{objectIds}}&Points={{pointNames}}

&From={{from}}&To={{to}}&format=json

Domain Aggregate Time Series Data Table Request to query nested tables of aggregate data per object (e.g. grab wind speed and active power simultaneously for each asset)

https://{{domain}}.bazefield.com/Bazefield.Services/api/

objects/timeseries/aggregated/table?Points={{pointNames}}

&ObjectIds={{objectIds}}&Aggregates={{aggregates}}

&From={{from}}&To={{to}}&Interval={{Interval}}

&InObjectTime=True&format=json 

Domain Objects & AttributesRequest to query domain object and attributes within Bazefield (e.g. lists of assets with their properties)

https://{{domain}}.bazefield.com/Bazefield.Services/api/

objects/structure?attributes=&format=json 

Domain Models & AttributesRequest to query domain model configuration data installed within Bazefield

https://{{domain}}.bazefield.com/Bazefield.Services/api/

configuration/domains?format=json 


Accepted Aggregate Inputs


Aggregate

Description

Total

Integrated value of tag in interval (e.g. TagTotal(ActivePower) = Production)

Average

Geometric average of all values in interval

TimeAverage

Time-weighted average of all values in interval

Count

Count of number of values in interval

Stdev

Standard deviation of values in interval

MinimumActualTime

Minimum value within interval

Minimum

Minimum value within interval

MaximumActualTime

Maximum value within interval

Maximum

Maximum value within interval

Start

First value within interval

End

Last value within interval

Delta

Last Value – First Value within interval

Variance

Variance of values within interval

Range

Maximum – Minimum value within interval




Postman queries

The tabular queries above can be modified and used within Postman directly by navigating to the correct request on the left hand collection tab.