DEV Community

Cover image for 🌟 Exploring the Postman Workshop: API 101 using Postman 🌟
rajdeep-mondal-hub
rajdeep-mondal-hub

Posted on

🌟 Exploring the Postman Workshop: API 101 using Postman 🌟

Image description
Today, I attended the “APIs 101 Using Postman” workshop conducted by the Postman Student Expert Sagnik Datta at RCC Institute of Information Technology, College Auditorium. The session was conducted amazingly, providing everyone with an overview of the Postman API Platform followed up by a hands-on session that covered basic request methods like GET, POST, PUT and DELETE along with responses. The presenter was very knowledgeable and offered valuable information and tips.

Image description

What is Postman?

On hearing or reading the word “postman”, we all think of a person whose job is to collect letters, etc. and take them to people’s houses. Here, by Postman we mean an API platform for building and using APIs. Postman is a very famous tool for interacting with HTTP API clients that enable Developers to generate, share, verify and file APIs. It offers its users a pleasant GUI for generating requests and responses. Also, simplifies each step of the API lifecycle and streamlines collaboration so we can create better APIs much faster.

Application Programming Interfaces (APIs) allow services to communicate with each other. APIs allow developers to access data from a service (like Google or Twitter) without any knowledge of how the codebase has been implemented. For everything, we want there is an API available for it.

Image description

Request - Response Pattern

A client is an entity that requests a server. Some examples of clients are applications like web browsers. A server controls resources and services. An API is an interface that exposes these resources + services to clients in a network.

The client can interact with an API by making requests over the network to the API. The API will then evaluate the request, perform the required operations, maybe interact with a database or other APIs, then send back a response to the client.

Image description

Making a Request

  1. Methods: GET, POST, PUT/PATCH, DELETE, etc.
  2. Address/Endpoint URL
  3. Path

Methods

  1. GET Method: Used to retrieve the information.
  2. POST Method: Used to add your own information.
  3. PUT/PATCH Method: Patch is for updating partial data of a record while keeping the other data, whereas PUT requests are designed to completely overwrite the existing data for a record.
  4. DELETE Method: Used to delete information.

Address/Endpoint URL

Endpoint URL {base_url}: http://postman-student.herokuapp.com/

Paths

  1. /quote for working with Quotes API.
  2. /joke for working with Jokes API.
  3. /book for working with Books API

HTTP Codes

When we make an API call, we will see the response values at the bottom.

For Status, 200 OK is usually the best response that the API works as 200 OK means Successful. Some of the other responses are: 201 Created

400 Bad Request

401 Unauthorized

403 Forbidden

404 Not found.

There’s the time to show the latency in milliseconds. This is useful for testing performance.

Image description

Features of Postman API Platform

The Postman API allows us to programmatically access data stored in our Postman account. Perform all the classic CRUD operations on our collections, environments, mocks, and more. The API “echos” back what we send to it, which is a great way to see what we’re sending to a server without having to analyze backend logs. We can send requests through various protocols (GET, POST, PUT), explore different authentication methods, and play around with different parameters.

Postman provides a programmable way to visually represent your request responses. It has a suite of external libraries available to use in the Pre-request and Test script tabs. These libraries make developers’ lives much easier by providing functionality not necessarily built into JavaScript. It also allows features like automating API tests. Postman documentation is one of its best features, adding to it they use the Daring Fireball syntax of Markdown, which allows us to easily add images and gifs to your documentation making it more interesting.

Top comments (0)