Developers corner

Rest API access

The University of Macedonia Data Portal is implemented by the Open source data portal software CKAN. CKAN provides a fully operational Restful API for all its core functionalities. Through the Restful API developers can implement CRUD operations on datasets according to the level of their authorization.

Full documentation for the use of the CKAN API can be found at the following URL: http://docs.ckan.org/en/latest/api/

A Quick tutorial can also be found at the following URL: http://docs.ckan.org/en/ckan-1.7.4/api-tutorial.html

The API path for HTTP requests in the University of Macedonia Data portal is: http://data.dai.uom.gr.data/api/

The message format for both the body of the requests and the answers is JSON (specified in RFC 4627).

An extended helper for all CKAN API endpoints and their json responses can be found in the api-helper page of CKAN. There you can view all available API calls and preview their results.

Datastore extension

The University of Macedonia Data Portal also uses the very powerful Datastore extension for the preview of structured data.

When a resource is added to the Datastore we can get:

  • Automatic data previews on the resource's page, using the Data Explorer extension among other extensions such as DataStore Graph, Datastore Map, Text View and Image View.
  • The Datastore API: search, filter and update the data, withouth having to download and upload the entire data file.

Full documentation about the Datastore API and its use can be found: here.

Tools for using the REST API

Generic HTTP clients and libraries

curl is a generic http command-line tool that can be used to query the API. It will be used in the sample queries below.

Some extensions exist for most of the popular browsers that will make it possible to build queries to the API within the browser, for instance Postman for Google Chrome or RESTClient for Mozilla Firefox.

Most programming languages can be used to query the API as long as there is a compatible HTTP connection component such as Jersey for Java.

Dedicated tools

Some specialised tools have been developed and can be used to facilitate use of the REST API:

A full list of CKAN API Clients in diferrent development languages can be found here.