Skip to main content

Featured

How to Visualize your JSON 🕵🏼?

A simple way to view and segregate the complex JSON Hello Peeps, Welcome back to another blog 😉. I hope everything is going well for you. Many people prefer the JSON format for APIs, databases, and other applications for a variety of reasons. Some JSON requests or responses are simple and only contain a few objects. On numerous occasions, you may be required to handle a complex response. I wrote a blog about parsing complex responses before using https://jsonpathfinder.com/ In most cases, however, you will need to further investigate your JSON payload or responses for various reasons and analytical purposes. Are you a visual learner or a fan of mind maps? Then you will undoubtedly fall in love with this tool ❤️ JSON Crack I recently came across this tool and found it’s worth sharing with the community 👓 Once you land on the home page, click “GO TO EDITOR” Now you will see a sample JSON beatified and visualized. To visualize it, clear the left side pane and paste your JSON. For instan

Postman 101!!

Dear Community,

Hope you all are safe and healthy!

It’s time to go back to some basics. We will discuss few basic things about API’s and Postman here.

What is Postman?

Postman is a platform to build, test, design, modify, and document APIs. It is a simple Graphic User Interface for sending and viewing HTTP requests and responses.

While using Postman, for testing purposes, one doesn’t need to write any HTTP client network code. Instead, we build test suites called collections and let Postman interact with the API.

Postman is a scalable API testing tool that quickly integrates into CI/CD pipeline. This tool is very convenient when it comes to executing APIs. Once we saved the details, we can simply use them over and over again, without having to remember the exact endpoint, headers, API keys, etc.

https://learning.postman.com/docs/getting-started/introduction/

Installation/Configuration process (Workspaces):

  1. Go to https://www.postman.com/downloads/
  2. Select the configuration needed

3. Your download is in progress and the message should now display on the Apps page. Once the Postman download is completed, click on Run.

4. Installation Starts

5. In the next window, Signup for a Postman Account. Use your email or sign up using Google here.

Building Blocks of Postman:

Building blocks of Postman are the essentials for every Postman operation.

They are:

  1. Workspaces
  2. Requests/Responses
  3. Collections
  4. Environment

1. Workspaces:

Workspace allows us to organize your API folders and requests. For the first time do it from “Home” page.

If there’s an existing workspaces, we can proceed like below:

Select the Workspaces dropdown menu and click “Create New”.

We can name them based on the project or work or as per your convenience. The “Visibility” field helps to mark the option for Team, Private, Public and Personal.

2. Collections:

Collections are a group of saved requests. We can call it as a repository to save our requests.

We can add any number of requests to a Collection, also can organize better using folders inside. This will help the Team to understand better about the flow or Test cases.

How To Create Collections in Postman:

Click on New

Input the Collection Name and description then click “Save” to create a new Collection.

3. Requests/Responses:

An API request allows us to retrieve data from a data source, or to send data. APIs run on web servers, and expose endpoints to support the operations client applications use to provide their functionality.

A request is a combination of the URL, HTTP headers, Body or Payload. In Postman , we can save your requests and use them in the future based on your needs.

We need a collection, to create a request under.

Click on New:

By this method, we need to first save the request under any existing collection to proceed. So, it’s always advisable to create the request using the below method:

This can be created under the specific collection/folder.

Basic Elements of the API Request​:

  • Method​
  • Base URL/Endpoint​
  • Resource
  • Payload (applicable for certain requests)
  • Headers

GET Request Example:

Here the base URL is “https://cat-fact.herokuapp.com” and the Resource is “facts” and Method type is “GET”.

POST Request Example:

For POST request, the “Body” section is passed based on the API design spec.

Below are the different options to pass the body,

Once we send the HTTP request to the server, the API response is received.

Basic Elements of the API Response​:

  • Body​
  • Status code
  • Headers
  • Cookies

Example Response:

To know more about the other frequently used HTTP request types, please refer this post.

4. Environment:

Environments in Postman allow us to run the Requests and Collections against different data sets. We could have different environments for Dev, QA, Stage & Production. Each of these environments will have different configurations such as BaseURL, User Name/Password and API keys etc.,

Environment contains key-value pairs of variables. Each variable name represents its key. So whenever we reference a variable name then it allows us to access its corresponding value.

To create a new environment, we do as follows

Click on New:

So the hierarchy is as follows,

Workspace -> Collections -> HTTP Requests

Environment is applicable for the specific workspace, means it is accessible to all the Collections/Folders/Request under the workspace.

I hope you learnt some basics today!!

May we meet again in another post!

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Originally published in https://bpricilla.medium.com/postman-api-1aefa0c2896f

Your feedback matters!! Please feel free to comment or drop your suggestion, I would love to hear them. Let’s connect in LinkedIn and learn from each other!!

Comments

Popular Posts