Overview on API
What is API?
Application Programming Interface(API) is a set of function that allows applications to access data and interact with external software components,OS or microservices.Application programming interfaces consist of two components:
- Technical specification describing the data exchange options between solutions with the specification done in the form of a request for processing and data delivery protocols.
- Software interface written to the specification that represents it.
You may hear the term “microservices” come up in relation to API. These however, are not the same. Microservices are a style or architecture which divides functionality within a web application. While API is the framework which developers interact with a web application. Microservices can actually use API to communicate between each other.
API lets a developer make a specific “call” or “request” in order to send or receive information. This communication is done using a programming language called “JSON”(Java Script Object Notation). It can also be used to make a defined action such as updating or deleting data.
There are four basic request methods that can be made with API:
- GET – Gathers information (Pulling all Coupon Codes). Possible Return Codes 200 (OK) + 404 (NOT FOUND) +400 (BAD REQUEST)
- PUT – Updates pieces of data (Updating Product pricing). Same return codes as get possible. In addition : Return code 201 (CREATED) is possible.
- POST – Creates (Creating a new Product Category).Possible Return Codes : 200(OK)
- DELETE – (Deleting a blog post)
API Specifications/Protocols:
While API follows a specific set of rules that determine how programs communicate with one another. REST & SOAP define how the API is presented. Each are similar in functionality but have several key differences and use cases.
REST stands for “Representational State Transfer” and is the set of rules that developers follow when creating an API. REST is read using JSON . One of these rules is that the API should be designed in a way that is easy to use and will make sense for developers.
SOAP or Simple Object Access Protocol is another design modal for web services. Instead of the typical JSON that REST API uses. SOAP uses a language known as Extensible Markup Language (XML). XML is designed to be machine- and human-readable. SOAP follows a strong standard of rules, such as messaging structure and convention for providing request or responses.
REST API standards as it’s mostly used in today’s world. Major companies such as Google, Amazon, eBay, and even BigCommerce use REST APIs. REST is generally the preferred choice amongst software developers.
This is Good for Beginner . @Joydeep
ReplyDelete