Use Case

This article describes how to use either chrome or IE, or another API tester application to query allocations generated in Bazefield.  Prior to this, it is suggested to read

Quick Start: Bazefield API

Quick Start: Tag Manager 

Exercise 1:  Querying API with Chrome and Postman 

Importing Post Man Files


Background

This article reviews how to request all allocations generated by Bazefield.  These are natively displayed in the Availability Application within Bazefield.


Prerequisites

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

Importing Post Man Files



Requests


The following table displays the list of most common requests to pull raw data from Bazefield tags.  They can be run directly in a web browser, or using Postman

(Substitute all {{ }} variables with user desired values)


Request

DescriptionURL Example
Get Historical Allocations (Single or Multiple Assets)Request allocations for a single or multiple assets for a given allocation typehttps://{{domain}}.bazefield.com/BazeField.Services/
api/allocations/{{allocationType}}/from/{{from}}/to/{{to}}
?turbineIds={{assetNames}}&showAvailable=True&format=json 
Get Historical Allocations (site)Request allocations for a site for a given allocation type within a given period
https://{{domain}}.bazefield.com/BazeField.Services/api/
allocations/{{allocationType}}/from/{{from}}/to/{{to}}
?turbineIds={{siteName}}&showAvailable=True&format=json
Get Availability Statistics for an entire site or collection of assetsRequest aggregate availability statistics, grouped by assets, root causes, or categorieshttps://{{domain}}.bazefield.com/BazeField.Services/api/
turbines/allocations/{{allocationType}}/statistics/from/{{from}}/to/{{to}}
?turbineids={{siteName}}&format=json&chartGroup=categories
&includeAvailable=True&includeExcluded=True&allocationCategoriesFilter&OrderBy= LostProduction+DESC&Take= 


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.  Editing the variables, and then selecting "Send" will send the request and return the data


Opening the requests, editing the variables, and clicking "Send" will request the data and return it to the application.