API
Application Programming Interface or API which is used to provide an interface to communicate between two application by mostly in JSON [Java Script Object Notation] response because it is lightweight to transfer between the data, but also in some other format like XMLTYPES OF API
PUBLIC API
This API can be used by any of the user without any restrictions. It is specifically designed to integrate to use or create new cases in any applications. Some public API may ask to create a free account to access their API keys and request calls.
PRIVATE API
It will let you to extract and work with data without any restrictions because this will mostly used for developing new technologies with vast data. The only disadvantage is it costs you more amount because it will allow you to make any number of calls per second unlike public api has many restriction when comes in to api call.
HTTP methods
- GET - It is used to get or retrieve data
- POST - It is used to create data
- PUT - It is used to update data
- DELETE - It is used to delete data
Categories of API and Protocol
Representation State Transfer In this communication can only occur through HTTP request. It is simple and flexible and more friendly for internet usage.
An API can be taken into account as REST API due to multiple criteria such as
REST is faster because it contains set of guidelines
which increased scalability
Principles of REST API
- It ensures same piece of data that belongs to one URL [Uniform Resource Locator]. It should all information that user need
- The client should not interact with server application . The server should pass only requested data and it shouldn't modify the client app
- Server apps are not allowed to store any data related to client
- To improve performance on the client side, while increasing scalability on the server side.
- The call and response go through different layers
- Response can also contain exe code it should run only on demand
Learn more
SOAP API
Simple Object Access Protocol (SOAP) is a message specification for exchanging information between systems and applications. When it comes to application programming interfaces[API]. It is structured and formalized. It focus on message and it provide guidance on structure of request and response. It uses xml as the data format for sending and receiving datas. It provides 4 dimension to API protocol
- Envelope - Defining the structure of the message.
- Encoding - Rules for expressing the type of data.
- Requests - How each SOAP request is structured.
- Responses - How each SOAP API response is structured.
Composite API
The composite API allows you to combine up to five API calls in a single request consuming just one credit per composite call. This API reduces the round-trip time and allows you to execute the APIs in a single database transaction. The execution will happen in sequence. In composite API if any one of the request fail you have an option to get back all the request before any changes.
RTT - Round Trip Time
It is the amount of time that request of the client to reach the server and get back the response of the request from the server
Web API
A web API has the functionality of browser. It is mostly seen in Javascript Programming Language. Using Web API we can access Geo location, Web History, Local storage On web browser. Some of the Web API's are
- Web Forms API
- Web Storage API
- Web Geolocation API
- Web Form API
Learn more
Parts Of URL
HTTP - Hyper Text Transfer Protocol
It is used to exchange files between web
HTTPS - Hyper Text Transfer Protocol Secure
It is a combination of HTTP with SSL [Secure socket layer] which is used to encrypt communication to avoid data stealing.
- Scheme - HTTP or HTTPS
- Domain - .com, .org, .club, .in, .co
- Path - used for navigation such as Home, Menu, About us
- Query String - It contains Key and value pair and it is separated by "&" ampersand. A query string can have any number of parameters. It always start after the "?" question mark.
- syntax - key=value&key=value&key=value in this we have three pairs and it is separated by ampersand
- eg : age=20&gender=male
- eg : www.domainname.com/people?age=20&people=male
API key :
An API key is a key which is used to authenticate or verify the user who is access the API's. It will help to provide you the safe transaction of data without any malicious act. Its like a login credentials which is used to identify your project or application. Once you are signed or registered with your project name in the desired application The API Key will be generated uniquely it can be included in the project for accessing data.
for example If you were to access google API let say "Google sheets API", you need to enter your app or project name to get the google API key with the API key you can start using HTTP methods as per the documentation to access Google Sheets API
const CLIENT_ID = '<YOUR_CLIENT_ID>'; which is like your user name
const API_KEY = '<YOUR_API_KEY>';
Frequently Asked Questions :
What is an API with real life example?
You order a food in food delivery app. The person from the food delivery app will take your order to the Hotel and return the ordered food to you. In this case The person is an API who is getting our requested food from the desired Hotel. In this case hotel is the server where the datas are stored or collected.
What is the full form of REST API?
Representational State Transfer is which contains set of condition of how api should work
What is an API Call?
Whenever a request is made to the server to get data from it. It is called API Call. It can be any number of call for a request of data. Delete, Edit, Get all are considered as a categories of API call.
What does it mean to fetch API?
fetch() is a method in Javascript to fetch or retrieve data and it returns a promise that resolves a response object. you can also optionally passes a init option object as second argument. It won't reject HTTP error status like 404 or 500.
When we try to access for "
Twitter". there you can see sign in with google account which is also an example of API usage. The twitter will fetch the data of your
Google account for authentication and login processing in Twitter.
Categories Of API
There are many kind of API available in the world of internet. you got to choose the desired API. Some of them are :
- Food API
- Movie API
- News API
- Weather API
- Car API
- Rest Countries API
- and vast number of Google API's are
API Tools
API Tools are the platform or application which decrease your configuration job in API. API Tools will let you perform any request and get a response from any website to check or test for the API data. You just have to have the authentication key and user id to perform these testing methods in these tools. In case if you want to be clarified with how such API's are fetching You could have these tools to make a test for the API's. There are plenty of tools for testing API's are available some of them are paid and some basic features are free to use.
Some of the API Tools are :
- Postman
- Testfully
- TestMace
- HoppScotch
POSTMAN
- 0$ - Free upto 3 users
- 12$ - Unlimited users can be collaborated with 1 custom domain and 10x calls
- 29$ - 5 custom domain and 100x calls
- 99$ - 25 custom domain plus 1000x calls and API security
visit TESTFULLY
It also supports for API monitoring for REST and GraphQL API.
- 0$ - Supports for 5 users and also provides SSO[Single Sign On] with Google and github
- 49$ - 10 users with 10 minutes interval of API monitoring and also supports SSO
- 99$ - 25 users with 5 minutes interval of API monitoring
- 199$ - 50 users with 1 minutes interval of API monitoring
visitTESTMACE
- Free - even for commercial purpose and using syntax highlighting
- 4$ - supports for advanced autocomplete feature
- 8$ - One click multi user synchronization
- Enterprise - Implement special feature for team request
visitHOPPSCOTCH
It is Open source API development ecosystem. here you can test any API for free with a very simple and understandable User Interface. It supports for GraphQL API and REST API.
Cookies
It is a pieces of data or text that is sent to your browser by the website that you visit. It is stored as key values pair in your system browser with a unique session id. whenever you visit a new website it asks your concern to accept cookies. So that you don't have to enter the information again and again.
For example You visit a site and accept cookies in case if you are searching any data in that website itself, It stores the data that you search so if you visit the site after sometime it will auto fill your search data you don't have to type.
Session
It is a data which is used or stored for specific period of time in the browser for the smooth experiencing of browsing.
For example if you visit a site and enter your login credentials it is stored in session in browser for specific period of time. If you visit those site again you will automatically logged in without entering credentials all the time that you are visiting.
Comments
Post a Comment