Sitemap
Damilola

Damilola

API 101 with Postman

4 min readApr 28, 2024
Press enter or click to view image in full size

Hi there friend 👋🏽, I’ll be sharing insights about APIs based on the knowledge I gained from the Postman API 101 Workshop for students that I attended yesterday.

So what are APIs?
API stands for application programming interface essentially, an API allows different software applications to communicate and interact with each other. It acts as an intermediary layer between different software components. Some examples are REST, SOAP, gRPC, GRAPHQL etc.

What is Postman then?
Postman is an API development platform developed by a group of Indian developers in 2014 now used by millions of developers globally.

Why Postman?

Postman provides a user-friendly graphical interface that simplifies the process of sending API requests.
It also offers features like organizing requests into collections, creating environment variables, creating automated tests, documenting APIs, and also provides debugging and inspection capabilities.

Before Postman, developers relied on cURL, a command-line tool for making HTTP requests. While cURL is powerful, it’s syntax can be overwhelming and less user-friendly.

Press enter or click to view image in full size
Working with APIs using cURL

Working with APIs with Postman

Get Damilola’s stories in your inbox

Join Medium for free to get updates from this writer.

Postman’s visual interface makes it easy to create, send, and organize API requests, without the need for memorizing command-line syntax.

Press enter or click to view image in full size
Working with APIs using Postman

HTTP Methods
POST: For creating a resource.
PUT: For updating a resource.
PATCH: For updating part of a resource.
GET: Getting a resource/collection of resources.
DELETE: For deleting a resource.

There are also others like HEAD, OPTIONS etc.. you can learn more about them here

Exploring the Books APIs

In the session, we explored the public API by Postman for working with books https://library-api.postmanlabs.com/books

So we’ll be working with a few methods on this endpoint. You can click on the new button to send make our first request on Postman, our baseUrl here is https://library-api.postmanlabs.com/books we set our request method to GET (meaning we want to get a list of books available on the URL). Then we hit send. We can see the result in the body tab.

Press enter or click to view image in full size

We can create our own books using the POST method. Just make sure to set the http method to POST and pass our book object in JSON format.

Press enter or click to view image in full size

We’ll also look at how we can delete a resource on this URL. Here, we’ll set the method to DELETE and ID of the book we want to delete (in this case our newly created book). Now we can see our resource (book) is deleted on the server

Press enter or click to view image in full size

HTTP Status Codes
1xx:
Informational — Provides information about the transfer protocol.
2xx: Success — Request was successfully received and processed.
3xx: Redirection — Further action is required to complete the request.
4xx: Client Error — The request contains incorrect syntax or cannot be fulfilled.
5xx: Server Error — The server failed to fulfill an apparently valid request.
You can learn more about http status codes here and also here’s a detailed list

I hope you enjoyed this piece. If so, feel free to connect with me on LinkedIn. I would also like to thank Postman for the gift of LinkedIn premium, which I received for winning the quiz session. Additionally, I’m hoping to win some swag items as well.

--

--