API(Application program interface) API is a set of routines, protocols, and tools for building Software Applications. In simple terms API acts as an interaction between two software applications to communicate with each other, when one application wants to access the data from the other application
Benefits of Using API
· Helps two different software to communicate each other
· Simple , flexible and more efficient
· It helps to embed content from any app or site more efficiently
· API adapts to change whenever the software is in need of change
Four main types of API
1. Open API or Public API: As the name derives its open for developers and other users. They focus on external users for the access of data.
2. Partner API: Need a licenses to access the API.They are usually intended for a specific purpose.
3. Internal API or Private API: This API is used internally in the companies. It’s not used for outside the companies but internal with different development teams for better productivity.
4. Composite API: This API combines different data and service. This helps in speeding the process by running synchronously and improving the performance.
Let’s see the what is REST API and SOAP API
Representational state transfer that defines set of functions that the programmers can use to receive and request the data.
In spite of the programming languages used in application RESTAPI used on universal HTTP protocol and the information returned in JSON format.
Methods Used in REST API:
1.POST : This is used to create a new data
2.GET : This is used to get the list of data
3.PUT : This is used to update any data
4.DELETE : This used to delete a data
SOAP API :
Simple Object Access Protocol is a XML based protocol for accessing the webservice over HTTP. A SOAP message is an ordinary XML document.
The following elements are contained in the document
Envelope: Start and end of the message
Header : Its an optional attribute used in processing the message
Body: The message in XML is sent
Fault: Any errors while processing the message