APIs are the intermadiator between client & server. It can pass data which can be understood by Desktop app or Mobile app or any other web app.
APIs are good for humans. A data somewhere you can use into your application. For example someone is tracking International Space Station live location all the time and store into Database. You can grab live location of ISS anytime by just using it’s API https://wheretheiss.at/w/developer
There a many type of API structures. But for web, we use REST API structure. REST API transfer the data on web using JSON file. It’s flat-pack format of data (compact the data into large string with “” & :). This is in compact view just because it can carry large data in to small packages. You can easily view any complex JSON string here https://jsonviewer.stack.hu/ in user friendly mode.
API URL is called Base URL. It’s may carry query string or path parameter. https://restcountries.com/v3.1/capital/kabul where “kabul” is path-parameter. While https://api.wheretheiss.at/v1/satellites/25544/positions?timestamps=1436029892,1436029902&units=miles “timestamp” & “units” are query parameters
When you want to send your JavaScript object data as API result we need to compact it first and convert to JSON format. To do so we use JSON.stringify(jsobject) method.
In reverse of it, if you want to unpack the JSON into JavaScript object, you can use JSON.parse(JSONString) method.
API authentication:
1) No Authentication
2) Basic Auth – Pass username & password encoded in base64 string
3) API key based Auth – Passing a valid key as query parameter or in header
4) Token based Auth- This is what we face when trying to login to Upwork using Gmail. We don’t pass username & password of Gmail to Upwork but Upwork ask Google to create a Token so we login to Gmail app only and token created, that token will be using by Upwork to login. So Upwork don’t have our username & password of Gmail but they have token only. Generally we use this most secure way of Authentication when user wants to post, update, delete some data on API server.
That’s it for now as very basic info.
In web word, SOAP & REST is most used API architectures. Do you want to know the basic difference then check this blog post.
And to become master of APIs, you need to follow this roadmap.
![API_GRaph](https://dilip-parmar.in/wp-content/uploads/2024/04/API_GRaph-1024x677.gif)
![](https://dilip-parmar.in/wp-content/uploads/2024/10/API-1-710x1024.gif)
![](https://dilip-parmar.in/wp-content/uploads/2024/10/API-version-Maping-683x1024.gif)
![](https://dilip-parmar.in/wp-content/uploads/2024/10/api-3-683x1024.gif)
![](https://dilip-parmar.in/wp-content/uploads/2024/10/API-performance-1-683x1024.gif)
![](https://dilip-parmar.in/wp-content/uploads/2024/10/API-testing-737x1024.gif)
![](https://dilip-parmar.in/wp-content/uploads/2024/10/API-Performance-2-674x1024.gif)
![](https://dilip-parmar.in/wp-content/uploads/2024/10/RestVsGraph-838x1024.gif)
![](https://dilip-parmar.in/wp-content/uploads/2024/10/API-Call-737x1024.jpeg)
![](https://dilip-parmar.in/wp-content/uploads/2024/10/API-gateway-737x1024.gif)