Categories
Archives
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- October 2010
- September 2010
Control API Response with new Fields parameter
We’ve added a new argument to practically every one of our API endpoints that allows you 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.
Tariff Example
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
TariffRate New Fields
Other Recent Changes
Also, be sure to check out our new Contracted Supplier Rate logic now in the Calculate API.
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.