How to test REST API’s with Postman on Ubuntu

With Postman API (Application Programming Interface) development tool, you can build, modify, and test APIs. In Postman, all functionality required by a developer are integrated. As much as 5 million users per month use this tool in order to simplify their API development.

In this article, we will explain how to install the latest version of Postman through Snap. We will also describe how you can send a Get request to hosted REST API to receive a JSON containing a list of users. This will illustrate to you how the application works.

We have run the commands and procedures mentioned in this article on a Ubuntu 18.04 LTS system.

Install Postman via Snap

You can install Postman via the Snap store through the Ubuntu command line. Open your Ubuntu Terminal either through the Application Launcher search or by using the Ctrl+Alt+T shortcut. Enter the following command in order to refresh the list of available packages:

$ sudo apt-get update

Update package lists

Since the Snap daemon comes by default in the latest versions of Ubuntu, we do not need to install it. If you are using an older version, you can use the following command:

$ sudo apt-get install snapd

Now type in the following command in order to install Postman to your Ubuntu:

$ sudo snap install postman

Install Postman

The process might take some time depending on your Internet speed, as it is a slightly larger package. The similar output as I got will indicate the completion of the installation and will also print the Postman version installed on your system.

Getting Started with Postman

Once you have installed the Postman API development tool, you can launch it either through the Application Launcher search as follows or directly through the Applications listing:

Start Postman

You can also launch the application through the Terminal by using the following command:

$ postman

When you launch Postman for the first time, it will display the following window:

Postman API testing tool

With this window, you can either sign up for a new account or simply skip the process by clicking on the “Skip signing in and take me straight to the app” button at the bottom. The advantage of signing up is that with a Postman account, you can better organize your workspaces, maintain backup, and sync data when using more than one device.

The next view would be the following:

Postman API Development Tool

Click the x button and you are ready to work with Postman.

Send a Get Request

Now we will describe how you can send a Get request to hosted REST API to receive a JSON code containing a list of users.

You are now on the Untitled Request tab. Keep, the default, “Get” as the request type and enter the following URL as “Enter Request URL:

https://reqres.in/api/users

Now click the Send button and you will receive a JSON response containing an array of users as follows:

Send a GET Request with Postman

If you ever want to remove the application, you can do so through the following command:

$ sudo snap remove postman

This should serve as a basis to learn how to create workspaces, environment, and collections. On learning how to do all that, do visit the learning center at https://learning.getpostman.com/