IHAN® Developer documentation

Productizers

« Back to index

The Productizers in the IHAN testbed are components that convert existing APIs to standardized data products. The communication protocol between the Product Gateway and Productizer closely follows the data product standards and right now there are no differences, though later on we might add extra authentication, verification, etc. methods to it. The concept and the first reference implementations of the Productizers are developed by Digital Living International.

How Productizers fit in the architecture

The existing data products you can implement a Productizer for are currently documented at github.com/digitalliving/standards/tree/master/draft/DataProducts, and if you want to connect a new kind of data source you should start off by creating the relevant standards for it.

Once you have the standards in place, the Productizer's job is to take the JSON body parameters in as specified in the standard, e.g. lat and lon in the /Weather/Current/Metric data product, do any transformation of them if necessary to communicate with the data source, figure out the response data e.g. via an API call or by accessing a database and transform it to the format required by the standard and return it to the Product Gateway.

E.g. an implementation of the /Weather/Current/Metric data product Productizer should take a request like this as the POST body:

{
  "lat": 60.192059,
  "lon": 24.945831
}

Then the response should be in a format like this:

{
  "humidity": 75.0,
  "pressure": 1007.0,
  "rain": false,
  "temp": 6.3,
  "windSpeed": 5.7,
  "windDirection": 220.0
}

For an example implementation of a Productizer check out github.com/digitalliving/ihan-productizer-example

Once you have the Productizer up and running, it should be registered to the Product Gateway.

© 2020, IHAN® Project