I have got this addiction to Linkedin and like most people keep scrolling on Instagram, I scroll at Linkedin. And one day, I came across something called the "Postman Student Expert Program". I knew about Postman and have used it before but never heard about such a program. That got me curious and after completing the program (which is btw, just 2 hours long😉), I think it is a great resource to learn about API and the usage of Postman. And here I am to share what I learned and why you should try it too.
What is an API?
I liked the analogy of a restaurant, that was used to explain API. So, consider a customer as an application or client, a waiter as an API, and the kitchen as the server. The customer will not go directly to the kitchen to get the order, or to cook a meal. They will ask the waiter to get their meals from the kitchen.
Similarly, an API or Application Programming Interface is an intermediary that allows two applications to communicate with each other. Here, the waiter is the API which allows the customer (application) to place and receive orders from the kitchen (server).
In real life, web browsers are a great example of API. When you search for something, it's like giving instructions. Acting as an API, the browser talks to the server on your behalf. It sends your request, gets the results, and brings them back to you. And that is how an API typically works.
REST API's
Now when it comes to creating APIs, there are different ways of building and consuming them. There are a lot of architectures by which API can be built eg. GraphQL and SOAP. But one of the most popular and widely used architecture is REST.
REST stands for Representational State Transfer. In this architectural style, everything (ie. data, user profiles) is treated like a resource and these are the primary operations performed by a RESTful API on that resource(s):
GET: Retrieve information about a resource
POST: Create a new resource
PUT/PATCH: Update an existing resource
DELETE: Remove a resource
This is the type of API discussed in the expert program.
quick note: HTTP
When learning about APIs, you will come across the term HTTP. HTTP stands for Hypertext Transfer Protocol. It is the set of rules or protocols that every web browser and server follows to communicate and transfer data. As we go through this blog, it's important to note that every API request is an HTTP request.
Why POSTMAN?
Now, there are a lot of tools to fetch data from an API. One of the popular and classic tools is curl. It is a CLI for making HTTP requests. We won't go into much detail about curl but the main limitation of curl is lack of ease of use.
That's where Postman comes in. Postman is a tool for API testing that allows developers to create and execute HTTP requests and test API responses. It is a user-friendly UI that helps developers quickly create, test, share, and document APIs.
Features of Postman
Here are some of the useful features that we learned in the program:
Dealing with multiple queries
if the information you are seeking is very specific, the number of queries can become quite large and confusing. Postman makes it easier to deal with.
Variables in Postman
Postman allows to you save URLs and keys for ease of use and increasing reliability. It reuses value to keep your work DRY (Don’t Repeat Yourself).
Postman Auth
This is one of the most useful features of Postman. Some APIs provide a key, which is used to authorize API requests. With Postman Auth, it is very easy to authorize requests and manage keys. It also provides security for the saved API key.
Scripting
Postman allows you to automate behaviors programmatically. It's a tool for developers and testers looking to streamline their API testing processes with precision and ease.
So, here's a quick intro to API and why Postman is used. The program was interactive and provided an on-hand project to work with Postman. Plus, it gives you a chance to apply for Postman Student Leader, which is a great way to be a part of this "API-first" community. You can register here.
Thanks for dropping by, and happy exploring!