Let’s recap a bit to understand the first about API before going in detail about the types of API.
- What Are APIs?
- Types Of APIs
- Ownership Types Of Web APIs
- The API that is available for public use is known as public APIs. For Example, let’s take google anyone can use Google’s API without any restriction. There is no restriction at all in open API
- Partner APIs
- Internal APIs
- Composite APIs
- Communication Level of APIS
- High-Level APIS
- Low-Level APIS
- Web service APIS
- SOAP API
- What does stateless mean in REST?
What Are APIs?
APIs are an acronym for Application Programming Interface which means a set of functions and procedures allowing the creation of applications that access the features or data of other applications, services or an operating system.
You can read more about API Integration in our previous blogs. Now moving on to four major types of API.
Types Of APIs
API Can be basically classified on the basis of the following Parameters.
1) Ownership types of Web APIs
2) Communication level of APIs
Let’s learn in detail about both parameters to understand the types of API.
Ownership Types Of Web APIs
On the Ownership level there are four main types of API:
- Open API’s
- Partner API’s
- Interna API’s
- Composite API’s
The API that is available for public use is known as public APIs. For Example, let’s take google anyone can use Google’s API without any restriction. There is no restriction at all in open API
Some Common Examples are 3Scale, Apigee, CapitalOne, Google, IBM, Intuit, Microsoft, PayPal, Restlet and SmartBear, etc.
For Partner API some amount of right or license is required so that a user can access the data. In simple words, partner API’s are those API’S which cannot be accessed publically and without permission. Normally these APIs are referred to as paid API so only the premium customer can access the particular data through API.
Examples of Partner API’s is Payment Gateways there API’s can only be accessed by the paid customer.
Both Open APIs and partner APIs are the tips of the iceberg because they are the most visible ones and are used to communicate beyond the boundaries of the company.
They are usually exposed to a public API developer portal that developers can access in a self-service model. While open APIs are completely open, there is an on-boarding process with a specific validation workflow to get access to partner APIs.
Internal API or you can say a private API can be defined as an types of API created within a company to interconnect several processes through it. The Internal API is the types of API which are used by a company for there employees. Internal API cannot be accessed by anyone outside the organization.
Composite APIs are those types of API that combines data and different API on many levels. Composite API helps the running of several processes through an API in a synchronized manner.
It is a sequence of tasks that run synchronously as a result of the execution where the result of triggering of a Composite API is the result of the execution and not the request that will contain the result of the execution at the request of a task. With the use of composite API, several difficult processes can run in synchronization.
Communication Level of APIS
There are three types of API on the Communication level
- High-Level API’s
- Low-Level API’s
- Web Services API’s
High-level APIs are those types of API that we use generally in REST form where programmers have a high level of abstraction; high-level API’s are created for limited functionalities only. Their usage is very much limited as per functionalities
Low-level APIs are those types of API that have a lower level of abstraction hence they are the most detailed, which allows the programmer to manipulate functions within an application module or within hardware at a granular level. Low-level APIs are used where there is a need for a detailed level of abstraction by the developer.
Web service APIS
Web APIs are the most important types of API topic of this blog. I am going to have a detailed blog about each of the subtopics. Stay tuned for the updates.
In web service APIs the classification is done on the type of communication and behavioral approach used in building APIs:
Web service APIs are the type of API that are tiny applications that use URLs or web addresses on the internet are to provide their services to desktop, mobile, web applications, and others.
SOAP can be abbreviated as Simple Object Access Protocol. These APIs are more complex than their peers. It has its own communication protocol called Simple Object Access Protocol which makes them a bit more defining than REST in terms of the level of security and the approach to how messages are sent.
SOAP offers comprehensive security, built-in ACID (Atomicity, Consistency, Isolation, Durability) compliance and retry logic for reliable messaging functionality which makes it more suitable for enterprise application which deals with banking transactions, LDAP interaction and more.
SOAP is a standardized protocol that has only proprietary XML format for transferring structured information that’s more function-driven. The APIs are used to send payloads which are data, type and communication preferences.
Since SOAP uses XML to send payloads hence it requires more bandwidth. In addition to SSL, support SOAP uses WS-Security, which is great at the transport level and a bit more comprehensive than SSL.
A due significant level of security SOAP-based calls can’t be preserved. The cleanser is firmly combined with the server, having an exacting correspondence contract with it which makes it increasingly hard to make changes or updates. Cooperating with a SOAP API needs information about everything even before you can even start an association.
The cleanser has worked in ACID consistency which lessens irregularities and secures the uprightness of a database by recommending precisely how exchanges can collaborate with the database.
Corrosive is obviously superior to information consistency models. Corrosive is utilized in auxiliary databases like Oracle’s SQL database to manage banking exchanges and stock administration in behemothic eCommerce stages.
The cleanser has effective/retry rationale worked in and gives a start to finish dependability through SOAP delegates.
The utilization situation where you need to utilize SOAP API in building an application is just the craving to accomplish an elevated level of security.
The SOAP detail incorporates:
The handling model: how to process a SOAP message.
Extensibility model: SOAP highlights and modules.
Convention restricting principles: how to utilize SOAP with a hidden convention, for example, HTTP.
XML-RPC (Extensible markup language – Remote Procedure Calls) is a protocol that uses a specific XML format to transfer data. XML-RPC uses minimum bandwidth and is much simpler and older than SOAP.
REST (Representational State Transfer) is an additional information-driven engineering style that we use in building REST APIs. REST APIs depend on URIs (Uniform Resource Identifier) HTTP convention, and the utilization of JSON for an informal group, which is a super program perfect. REST APIs can be easy to fabricate and scale when contrasted with different kinds of APIs.
To be a REST API, an API must hold fast to certain structural imperatives, or standards, including:
Customer server design: the interface is isolated from the backend and information stockpiling. This takes into consideration adaptability, and for various parts to advance freely of one another.
Statelessness: no customer set is put away on the server between demands.
Cacheability: customers can store reactions, so a REST API reaction should unequivocally state whether it very well may be reserved or not.
Layered framework: the API will work whether it is discussing straightforwardly with a server, or through a delegate, for example, a heap balancer.
REST APIs encourage customer server correspondence with effortlessness.
REST APIs use SSL security which implies it can utilize HTTPS.
REST APIs utilize various information positions including plain content, HTML, XML, and JSON sending payload which is an incredible fit for information and yields more program similarity.
The utilization of easier information positions makes the payloads lighter which makes REST APIs be a superior fit for a more extensive scope of uses.
REST APIs utilize a solitary uniform interface. This disentangles how applications communicate with the API by requiring they all interface similarly, through a similar entry. This has points of interest and hindrances.
REST calls can be stored.
REST APIs are best for unwavering quality and adaptability.
The reasons why you might need to fabricate an API to be RESTful on the grounds that it incorporates asset impediments, fewer security necessities, program customer similarity, discoverability, information wellbeing, and adaptability.
What does stateless mean in REST?
In REST (Representational “State” Transfer) architecture it is defined that the server does not store any state about the client session on the server-side. This restriction is called Statelessness. Each request from the client to the server must contain all of the information necessary to understand the request and it cannot take advantage of any stored context on the server.
The Session state is therefore kept entirely on the client. The client is responsible for storing and handling all application state-related information on the client-side. It also means that the client is responsible for sending any state information to the server whenever it is needed. So, there should not be any session affinity or sticky sessions on the server.
Learn more about the technical aspects of creating digital properties in our upcoming Content Management Systems blog series.