What is API

 API 

What is API ? 

An API(Application Program Interface) is a set of routines, protocols, and tools for building software applications. Basically, an API specifies how software components should interact. API allow access to data and interact with external software components, operating systems, or microservices.

Types of API 

Web APIs

Web APIs are APIs that can be accessed using the HTTP protocol. The API defines endpoints, and valid request and response formats. 

Open APIs(or External APIs, Public APIs)

These are available for developers and other users with minimal restrictions. They may require registration, and use of an API key, or may be completely open. They are intended for external users to access data or services. 

Internal APIs 

In contrast to open APIs, internal APIs are designed to be hidden from external users. They are used within a company to share resources. They allow different teams or section of a business to consume each other's tools, data and programs. 

Partner APIs 

These are similar to open APIs, but they feature restricted access, often controlled through a third-party API gateway. They are usually intended for a specific purpose, such as providing access to a paid-for service. 

Composite APIs 

Allow developers to access several endpoints in one call. 

Types of API Architecture

REST(representational state transfer)

Popular web architecture. REST URI contain details such as query parameters. 

To be a Rest API, an API must adhere to certain architectural constraints, or principles, including: 
  • Client-server architecture: the interface is separated from the backend and data storage. This allows for flexibility and for different components to evolve independent of each other 
  • Statelessness: no client context is stored on the server between requests 
  • Cacheability: clients can cache response, so a REST API response must explicitly state whether it can be cached or not
  • Layered system: the API will work whether it is communicating directly with a server, or through an intermediary such as a load balancer

JSON-RPC and XML-RPC (remote procedural call)

JSON-RPC uses JSON to encode itself and XML-RPC uses XML to encode itself. A call can contain multiple parameters, and expects one result. These are designed to call methods, whereas REST protocols involve the transfer of documents. RPC URI identifies the server, but contains no information in its parameters. 

SOAP(simple object access protocol) 

SOAP is an established web API protocol and is intended to be extensible, neutral(able to operate over wide range of protocols such as HTTP, SMTP, TCP and more), and independent(from any programming styles). SOAP specification includes: 
  • Processing model to determine how to process a SOAP message 
  • Extensible model to determine SOAP features and modules
  • Protocol binding rules to determine how to use SOAP with underlying protocol
  • Message construct to determine how to structure SOAP message

REFERENCE 

Types of APIs

Comments

Popular posts from this blog

Fetching random cat pictures using openAPI