POSTMAN is a Client API, which is used to develop, test, share and document APIs. We can create APIs, perform automation testing of APIs, and create documentation of the APIs. Learn more about APIs here.
Go to the following link
Create a free account.
Go to the following link
Click on download according to the system.
Open the downloaded and download according to the OS type.
Open the application and sign in.
Open the POSTMAN application and on top click on My Workspace.
Click on create a workspace.
Make it a personal workspace, give it a name and add description if needed.
Click on create workspace.
To create a request click on new located at the top left and click on request.
But before, we need to get a simple rest API request which can be accessed from here.
We will be selecting a single user API. This will provide the sample json file containing name, email, etc.
Click on the request button and copy the url of the json file opened in the browser.
Create a new request and name the request.
Inside the collections click on create collection.
Give it a name and click on create collection.
Now, again in the GET field we will provide the URL which we copied from the request button link.
By clicking on the send button we will get a response in the response area which is an example of a simple API get request.
A collection is a group of API requests, where the API requests can be stored and saved in a logical manner. Collections can also be created by going to the new section at the top. There we need to provide some parameters like authorization, pre-request script, test, etc. This forms the basis for advanced operations in POSTMAN.
In description we can make a description of our collection.
Authorization is useful when we are going to have a number of requests in a collection.
In variable, we can define any variable.
We can also create various folders inside our collection.
Create a new get request named GET User List.
In the collection selection area select the Collection1 area, which was created before.
Search for another Sample Rest API from here.
Copy the URL of the API inside the POSTMAN.
In the GET section paste the copied link.
Click on save and then send.
To make a more logical grouping and arrangement of the requests, we will make two folders inside Collection1.
Right click on Collection1 and select new folder.
Name as GET and POST which will contain the GET and POST requests respectively.
To run the collection, click on the arrow located at the right of the Collection1 and click run.
This will redirect us to a collection runner window.
Here we can see all our requests and customize their way of operating, such as iteration, delay between the iterations, environment, etc.
To run the collection, we need to click on Run Collection1, which will return the result of collection.
This window shows the status of every request and time taken to execute the requests.
Variables are the elements in the data store which can take different values.
For example: in the case of the GET User and GET UserList requests, the initial part of the Urls are the same, hence they can be defined at collection level, environment level or global level.
To create a variable at collection level:
Click on Collection1 and then click on the three dots.
Click on edit, then click on variables.
Click on add new variable, then add the url which is common in both requests.
Click on update .
To use the variable, update the url of the requests by giving the name of the variable in curly braces.
An environment is a set of key value pairs in post; we can use these key value pairs in the requests.
First we need to get some sample Rest APIs. Click here
This time it is going to be a post request.
In the POSTMAN window create a new folder inside the named POST which contains all the post requests.
Create a new request named User Registration and choose POST folder inside the collections.
In the POSTMAN window, select the user registration and paste the URL as POST.
In the browser copy the body of the request (on the left of the image).
Inside the POSTMAN window, click on body and then click on raw and add paste the body.
Click on headers.
Select key as Content-Type and Value to application/json.
Select save and click on run, which returns the token.
Create an environment using a new tab, and inside the new window.
Create by referring to the below image.
The requests, urls and the body of the request can be modified as follows for a modular approach.
Click on the three dots available at the collection folder.
Then click on export.
In the next dialogue box, choose the collection which you want to export and click on export.
Choose the desired location where we want to export the collection.
Click on import in top-left, then click on upload file and select the desired collection which needs to be imported.
To export environment, select the settings icon on the upper-right corner to open manage environments.
Click on download environment and browse to the location where the environment needs to be exported. A success prompt will be displayed at the bottom.
Open manage environments as described above.
Click on import and click on choose file.
This will also come with a success prompt.