techtext ipoint

(1) API - concept description

API - General ideas

API - Application Programming Interface is quite a broad concept. As a generalization it may be useful to think of API as a set of ways of communication among various components. These components can be compared to other units of different kind that communicate each other, that have their common language of communication, of exchange of thoughts, views and needs. In particular, we communicate each other - the origin of spoken and written languages is quite a long story. Words take on new meanings over the centuries and years and new forms of recording and use.

After printing had been introduced to Europe with mechanical movable-type printing press by Johannes Gutenberg, the Printing Revolution in Europe started and his work is considered a milestone of the second millenium, marking the modern period of human history. Nowadays, the world-wide trend on the development of means of communication is up, we communicate probably more, faster and in more sophisticated way. This to large extent is because of huge development of Information Technology, for the reason of large and growing synergy of IT and business. And in this era of digital industry, e-commerce, remote forms of performing many activities, it’s becoming increasingly clear that a strong relationship emerged between these contemporary phenomena and the need to develop and improve new forms of communication.

With reference to communication in the context of Information Technology a crucial role plays the concept of API - Application Programming Interface. It is defined as ”a set of clearly defined methods of communication among various components”. There are several directions to go in with this topic area, solutions in this field also have already got quite a significant history. When we focus on the subject of Internet technologies, we can regard it as providing a certain range of possibilities through a particular services that are available on the network. And importantly, the network do tackle a couple of things as a transport layer, and due to that, services hosted on different, often very geographically distant computers can communicate each other, which reference the idea that they use a special ways of communications constituted in API.

API Types

There have been a few API classifications and types introduced (Operating System API, Library API, Remote API, Web API), API has grown up over last years and arrived at the level where today many of the most popular web applications would not exist without API.

Currently, we reached the point where API enables companies to open up their applications functionality and data to other units and business partners, external third-party developers or internal departments. API is a software interface, a code that allows different applications, different components, services and products to interact, to communicate with each other - and it is a documented interface.

Regarding common and proven API types, Web API should be mentioned in particular as most today APIs are Web APIs.

Web API

Web API is an API exposed by a web component, allowing other components to interact with it. They are APIs which expose an application’s functionality and data to a web browser, mobile device or other client over the internet. Web API is platform independent, its calls can be made with the usage of any programming language or by websites using HTML.

We can distinguish such types of Web API:

  • Open APIs (open source, publicly available also known as public APIs, which have defined API endpoints and request and response formats)
  • Partner APIs (with specific rights or licenses to access them)
  • Internal APIs (developed by units, companies to use in their internal, private systems)
  • Composite APIs (the ones that combine multiple data and service APIs)

While using of APIs has increased, specified API protocols have been developed:

  • SOAP - Simple Object Access Protocol, designed in 1998 for Microsoft, XML*-based
  • REST - Representational State Transfer, designed in 2000 by Roy Fielding, URL* + JSON* -based, message style
  • GraphQL - developed in 2012 internally by Facebook, released publicity in 2015, enables very flexible querying, updating and subscribing to data changes, JSON-based, requires some upfront development effort
  • gRPC - developed in 2015 by Google, supports bi-directional and streaming messaging, performant, but requires specialized libraries

The one that seems to be extremely popular and became De Facto Standard for APIs is REST. In the next section there is the description of how API works, how the communication within API looks - on the example of REST.


HTTP - Hypertext Transfer Protocol
XML - Extensible Markup Language
URL - Uniform Resource Locator
JSON - JavaScript Object Notation

How it works - context REST API

According to the previous considerations about communication, an API is a set of rules that state how components / computers / applications communicate with one another. These rules are usually defined in an API specification.

In general, this process of API working can look like this:

  • A client component initiates an API call (a request) - to retrieve a resource, an information (with the usage of GET verb/method). This request is processed from a client application to a web server.
  • The server sends a response to the API with the required data
  • The API then transfer the data to initial requesting component/application

There are also available others verbs/methods: POST to add new objects, PUT, PATCH to update them, and DELETE to remove them.

With reference to REST API we say that it enables the transfer of representation of a resource’s state.

The following figures show in an illustrative way the example of communication within REST API:

Figure 1

Figure2

What’s also interesting, API uses response codes. They notify clients about the status of the request, if it succeed, if it failed and what kind of error occurred. Most client applications checks for response code ad act accordingly.

There are five response code groups and each group contain its status code. Probably, the most popular from user perspective is the response code from client error group, with the status 404 - page not found. We sometimes get it with some strange or funny pictures, when we try to go to some website which for example has been removed.

When it comes to language that is used to communication within API, XML should be mentioned as at the one that has been used very often, but in today’s solutions dominates JSON.

Here we have some simple example of JSON file that contains some users data:

Figure3

APIs in modern IT applications and systems

With reference to the fact that companies open up access to their resources, with the usage of API, they are an important aspect of modern digital business.

Although for the descriptive purposes we can image an example that can often appear in the context of API that is not connected with IT, from daily life, example with restaurant menu. When we read menu card and order some dish from it, we can say we use it as an APIs. After a while we get out order. However, it all is not that simple as it looks because there is some process that takes place between. We don’t immerse in it. We just use a menu card.

So, in such a situations we deal with some ways of behavior in restaurant, with menu that has its own format, &c. So its just a communication based on some rules.