Testing API Using Postman
Hello everyone. Before continuing with the Gauge series, I would like to talk a little bit about how to test an API using postman. First of all, let’s talk about what an API is, then we will talk about how to test this API using postman. If our teas are ready, let’s get started.:)

What is this API(Application Programming Interface)?
We can simply say that it is a software tool that allows two applications to talk to each other. Let’s say you’re going to the office tomorrow, but you have no idea about the weather. When you try to learn the weather forecast from your phone by connecting to the internet, it will provide this service to you through an API.
How does the API Work?
Let’s say you go to a nice Italian restaurant for dinner. You sat down at the table, studied the menu, and now it’s your turn to order. You called the waiter to place your order. The system that will prepare your order is the kitchen, but you need an intermediary to communicate. In this process, the waiter will deliver your order to the kitchen, prepare your kitchen orders, and then the waiter will bring your orders to the table. In this whole process, the duty of the waiter who takes your order from you, delivers it to the kitchen and brings your order to you is the same as the duty of the API. In short, the API is the tool that carries out this communication between you and the system and brings you the results. By the way, if you want pineapple on your pizza, the API can be extended.
So what does Postman do?
Postman is a tool that lets you test your APIs without writing long lines of code. You can either install Postmani as an add-on to your browser or you can use it by downloading it to your own computer. It is also a tool with which you can document your existing APIs and call it “rest-client”. You can also use these APIs by creating collections.
Let’s test the API with Postman
We need collection to use Postman. For Postman use, we must create a collection when we open the Postman for the first time. You can create it as in the image below.

If you already have a collection, you can skip this step.
Now we need to click on the “New” button to create a new method.

We will see that the window in the first image opens. here we need to click on the create new request button.
Then we can choose the method of the request we want to create. I will talk about what the requests we will create mean at the end of the article.

After choosing our method, we need to write the url to which we will send the request in the Enter request URL part.
- In the Authorization part, if an authentication is required at the endpoint to which we will send the request, we have to enter the required entry. Otherwise, our request may return as an auth error.
- Required header information should be entered in the request to be sent in the Headers section.(Content-Type)
- The data to be sent to the address whose endpoint is specified in the Body section is entered. The type of this data can be in formats such as raw, JSON, binary.
After entering all necessary information, we can send our request by clicking the Send button.

The result will return us the results that we expected or did not expect from the endpoint.
We sent a request but where is the Test?
While performing API tests with Postman, scenarios and collections that we have prepared before will be prepared. As testers or the quality assurance team, we already know what results should return from these requests. We can create a collection for each feature and design it in accordance with our scenarios. We can run these collections we designed one by one with a single request and list the results. By accurately reporting the results we receive and sharing them with the developer team, we check whether the endpoints created are working as expected.
We already have the results we expect and our acceptance criteria when performing both UI testing and API testing. After getting these results, we can compare them with the expected results and show how successful we are. Then, by reporting these results, we can document the works we have tested and produce a product that is as error-free as possible for the production environment.
A Small Summary of HTTP Request Methods
- GET : The
GET
method requests a representation of the specified resource. Requests usingGET
should only retrieve data. - HEAD : The
HEAD
method asks for a response identical to aGET
request, but without the response body. - POST : The
POST
method submits an entity to the specified resource, often causing a change in state or side effects on the server. - PUT : The
PUT
method replaces all current representations of the target resource with the request payload. - DELETE : The
DELETE
method deletes the specified resource.
It was an article where we briefly talked about Postman, API and HTTP requests and saw how we can perform API tests using Postman. I hope it was useful. I wish you good reading and good health.