Control API Response with a New Fields Parameters
By Michael Ihle
| Reading time 2 minutes
We’ve added a new argument to practically every one of our API endpoints that allows your energy app developers more control over the data that’s returned to you. By optionally passing in the parameter “fields” with a value of “min” (for minimum) or ‘ext’ (for extended) your response payload will contain only the data properties flagged as part of the minimum or extended views respectfully. If you don’t pass the fields property then you’ll get the standard fields. The minimum view is designed to make the payload small (and thus quick to load). It’s ideal for situations like building drop-down list or auto complete input boxes. The standard view contains the properties that are commonly used, and is good for showing search results, doing standard computations, and so on. The extended view contains data that is usually not needed but sometimes of use.
Over the past few months we’ve been adding new fields to our tariff data. These are now available as part of the Tariff API and can be accessed by using the new ‘fields’ argument. Here are a few examples. Up-to-date information on the Tariff and TariffRate data is available on our GDN documentation website.
Tariff objects new fields
|customerCountSource||String||E||Where we got the customer count numbers from. Typically FERC (form 1 filings) or GENABILITY (our own estimates).|
|minMonthlyConsumption||Decimal||E||When applicable, the maximum monthly consumption allowed in order to be eligible for this tariff.|
|maxMonthlyConsumption||Decimal||E||When applicable, the minimum monthly consumption allowed in order to be eligible for this tariff.|
|minMonthlyDemand||Decimal||E||When applicable, the maximum monthly demand allowed in order to be eligible for this tariff.|
|maxMonthlyDemand||Decimal||E||When applicable, the minimum monthly demand allowed in order to be eligible for this tariff.|
|hasTariffApplicability||Boolean||E||Indicates that this tariff has additional eligibility criteria, as specified in the TariffProperty collection (below).|
TariffRate New Fields
|fromDateTime||DateTime||If populated, this indicates the rates effective date is not the same as that of its tariff|
|toDateTime||DateTime||If populated, this indicates the rates end date is not the same as that of its tariff|
|transactionType||String||E||Indicates whether this rate is BUY (no credit when supplying back), SELL (e.g. a feed in tariff), or NET (you get a credit, e.g. net metering).|
A Word on Version Control
Note, the extended view will also contain any new fields that we add to our data model. When using the extended view, your client code should be flexible enough to handle these additional fields (i.e. not crash if a new field appears in the extended view). Our minimum and default views are less likely to change, and any changes will be communicated well in advance. For past changes, see the History sections in our API documentation and our Releases page.
So, go ahead and give the new Minimum and Extended views a try. Hopefully, this makes your energy app development easier!
Be sure to let us know if you have any questions.
Also in Products
By John Tucker | Dec 14, 2012
By John Tucker | Sep 11, 2012
By Eric Danziger | Sep 10, 2012
By John Tucker | Apr 6, 2012