Pull data from third party REST API
Overview
If an organisation is hosting a SDMX REST API, then it is possible to pull structural metadata and data from this service into your local Fusion Registry instance via a number of web service calls. There are two ways this can be achieved. The simplest way is to use the Fusion Registry data portal feature (in Beta). Another approach is to use the Fusion Registry load structures/data pages and insert the appropriate REST URL. The benefit of the data portal is that the Fusion Registry does all of the work for you, it handles errors and merging of structures, it will even split the data query into multiple parts if the end service does not support large queries. This how to guide discusses both approaches.
For the purpose of this 'how to' the web service of the European Central Bank will be used, the API can be found by Googling 'ECB SDMX REST API' which at the time of writing links to this page:
The important thing to look for in a REST API is the entry point. The URL is the constructed by taking a base URL and postfixing the query parameters to the end, for data queries this starts with the word 'data' and for structure queries it starts with the structure type being queried, for example 'codelist'. On the ECB REST API page, example queries are provided which look like this:
http://ec.europa.eu/eurostat/SDMX/diss-web/rest/data/nama_10_gdp/.CLV10_MEUR.B1GQ.BE/?startperiod=2005&endPeriod=2011
The important part of the above URL is everything before the path /data/, this is the entry point to their web service, which is as follows:
http://ec.europa.eu/eurostat/SDMX/diss-web/rest/
We can use this URL to construct queries for both data and structures, for example
http://ec.europa.eu/eurostat/SDMX/diss-web/rest/codelist = query for all codelists
== Use Case