RESTful API and Why Is It Good for Your Lab?
5 min read, 3 min video
With the latest SciNote upgrade, we’ve released the first version of the RESTful API for SciNote. In this article, I’d like to explain what an API actually means – for those who are not familiar with the technicalities of it – and why it is really good to have one in 2019.
RESTful API (application program interface) is, very broadly, a mechanism that allows 3rd party applications used in the laboratory (e.g. LIMS systems, management systems, CRM, ERP systems, …) to access SciNote data (and vice-versa) in a standardized, structured, documented and secured manner. RESTful APIs nowadays are one of the key concepts behind software integrations, interfacing and interoperability.
Introduction
I’d like to start this article by going back into the past for a while. If you’ve been born in the 80s or early 90s, like me, there’s a chance you might still remember what the earlier web pages used to look like. Back then, nobody was talking about web applications. Web was pretty much a gigantic repository of so-called “static” web pages, where each individual web page was identified by a unique identifier that you typed into your browser bar – an URL!
Each web page was comprised of lots of text, some basic styling and formatting (some tables, colors, images), and some hyperlinks to other web pages. That was it! No animations, fancy user interactions, etc. You might remember the Bob Dole/Jack Kemp presidential campaign website, Netscape home page, or similar web pages that were popular in the 90s.
To summarize, web used to look like something along these lines. It’s really remarkable how far we’ve come since then!
As you can see, there is no coloring, paragraphs, etc., only some basic formatting. This is because – as I mentioned – a RESTful API is all about the data, and not the visual representation of it. Most of the time, RESTful API deals with textual data, but there are methods to handle various other formats such as images, videos, etc., as well. It all boils down to ones and zeroes in the end, right?
Coincidentally, a RESTful API looks very similar to this. A RESTful API is a set of defined URLs that users (or, more often, computers) can query, to retrieve, modify, or create data. The big difference is that on the web site, a lot of things are going on that relate to the way we humans perceive information. There are text paragraphs, titles, colors, different fonts and font sizes, alignments, and so forth. More often than not, these things are not actually part of the data itself, but merely add to the presentation of the data. Since computers don’t really care about visual representation, but only about the data, these things can easily be omitted, and as a result, RESTful API only deals with data, and metadata (data about data… confusing, right!?).
Examples for tech-savvy readers
An example of two RESTful API URLs within SciNote are the following:
The first URL will, upon being requested by a program/script/user/browser/…, return all the projects within the team with the given team ID, and the results should look something along these lines (I’ve omitted some metadata for clarification):
While the second URL could, for example, return a single user-project association that is the sole user on the given project (with the given project ID), e.g.:
If you check the examples above, there is a certain basic structure in the way the data is formatted. SciNote RESTful API uses a very popular data format called JSON (JavaScript object notation), which is a lightweight specification of how to format text data, and various relationships between data objects (e.g. key-value pairs and lists).
If you imagine, the list of various URLs that comprise a RESTful API can quickly grow large:
If you like this post, also check out
Looking for a partner in your digitalization journey?
Talk to our team & get the top-rated customer service in the ELN industry.