The API published with the Open-DAI platform are exposed through an API store.

This store allows developers to read the published documentation and to test the API on the fly.

The store, as shown in the figure below, offers a console where is possible to test the API, thus better understanding how to use it.

store

The project during the final WP6 phase decided to opt to use as publishing protocol for the API the oData one.

Open Data Protocol (OData) is a RESTful data access protocol initially defined by Microsoft. Versions 1.0, 2.0, and 3.0 are released under the Microsoft Open Specification Promise. Version 4.0 is being standardized at OASIS, and was released in March 2014.

This decision has been made to streamline the pipeline of publishing of the legacy DB:
the legacy DB is transformed using the TEIID component into a Virtual DB and this DB is thus exposed in its new aspect in a oData protocol.

Developers get an easier option to use the published data since there are many tools that ease the oData usage.
The following is an example of how simple is to have a web page showing the tabled content coming from one of the published API.


<html>
<head>
<title></title>
<!--jQuery References-->
<script src="http://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.min.js" type="text/javascript"></script>

<!--Theme-->
<link href="http://cdn.wijmo.com/themes/aristo/jquery-wijmo.css" rel="stylesheet" type="text/css" />

<!--Wijmo Widgets CSS-->
<link href="http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20141.34.min.css" rel="stylesheet" type="text/css" />

<!--Wijmo Widgets JavaScript-->
<script src="http://cdn.wijmo.com/jquery.wijmo-open.all.3.20141.34.min.js" type="text/javascript"></script>
<script src="http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20141.34.min.js" type="text/javascript"></script>
<!--Wijmo Ajax Data-->
<script src="http://cdn.wijmo.com/interop/wijmo.data.ajax.3.20141.34.js" type="text/javascript"></script>

<!--Knockout JS Library-->
<script src="http://cdn.wijmo.com/wijmo/external/knockout-2.2.0.js" type="text/javascript"></script>

<!--Wijmo Knockout Integration Library-->
<script src="http://cdn.wijmo.com/interop/knockout.wijmo.3.20141.34.js" type="text/javascript"></script>

<script id="scriptInit" type="text/javascript">
$.support.cors = true;
var viewModel;

function ViewModel() {
var productView = new wijmo.data.ODataView("http://api.opendai.eu/api/strutture_sanitarie/1.0.0/struttureUOF", {
ajax: {
dataType: "jsonp",
data: { "$inlinecount": null }
},
pageSize: 10
});
productView.refresh();

this.products = productView;

this.clearFilter = function () {productView.filter(null);};
this.filterAmbulatoriali = function () {productView.filter({ TIPO: "ambulatori" });};
this.filterCdc = function () {productView.filter({ TIPO: "cdc" });};
this.sortId = function () {productView.sort("id");};
this.sortPrice = function () {productView.sort("TIPO desc, STRUTTURA");};
this.clearPaging = function () {productView.pageSize(0);};
this.setPaging = function () {productView.pageSize(10);};
this.prevPage = function () {productView.prevPage();};
this.nextPage = function () {productView.nextPage();};
}
$(document).ready(function () {
viewModel = new ViewModel();
ko.applyBindings(viewModel, $(".container").get(0));
});
</script>

</head>
<body>
<h2>Example of showing data</h2>
<table>
<tr>
<th>Filter</th>
<td>
<button data-bind="click:filterAmbulatoriali, button: {}" type="button">Ambulatoriali</button>
<button data-bind="click:filterCdc, button: {}" type="button">CDC</button>
</td>
</tr>
<tr>
<th>Sort By</th>
<td>
<button data-bind="click:sortId, button: {}" type="button">ID</button>
<button data-bind="click:sortPrice, button: {}" type="button">Tipo, Struttura</button>
</td>
</tr>
<tr>
<th>Pages</th>
<td>
<button data-bind="click:clearPaging, button: {}" type="button">Clear Paging</button>
<button data-bind="click:setPaging, button: {}" type="button">Page Size = 10</button>
<button data-bind="click:prevPage, button: {}" type="button">Previous Page</button>
<button data-bind="click:nextPage, button: {}" type="button">Next Page</button>
</td>
</tr>
</table>
<h3>Products</h3>

<table id="demo-grid" data-bind="wijgrid: {
data: products,
allowEditing: false,
allowSorting: true,
showFilter: true,
allowPaging: true,
columnsAutogenerationMode: 'none',
columns: [
{ headerText: 'ID', dataKey: 'id' },
{ headerText: 'ID unit? operativa', dataKey: 'ID_UNITAOPERATIVA' },
{ headerText: 'Struttura', dataKey: 'STRUTTURA' },
{ headerText: 'Descrizione', dataKey: 'DESCRIZIONE' },
{ headerText: 'Tipo', dataKey: 'TIPO' }
] }" >
</table>
</body>
</html>

To further help developers the console in the store is generated by a swagger file that can help getting information on how to use the API.
Swagger is a simple representation of RESTful APIs.