APIs 101 with Postman

APIs 101 with Postman

#PostmanStudent #APIswithPostman

A session on “API 101 with Postman” was conducted by Mr. Wilfred Almeida — Postman Student Expert on 29th October 2022. The session really proved to be awesome as he explained about API’s briefly and on Postman. The hour-long session started off with basics and it caught the glimpse of what API is. It is

Application Programming Interfaces (APIs) allow services to communicate with each other. Software has become more complex and collaborative over the years. Developers no longer need to create every service from scratch. APIs allow developers to access data from a service (like Google or Twitter) without any knowledge of how the codebase has been implemented. The example given by the speaker really gave an insight to what an API is. The API for Instagram posts and pictures which are lived through it was understood. He also gave an idea on how Camera API works and what goes behind it to make the picture visible to everybody unlike local hosting. Microphone API feature, Cat API, The Cat API, OpenWeatherMap, Genius, Discord, Youtube to MP3, Spotify, Twitter, Facebook, Google, and many more applications which uses API’s. API’s can be customized as well. The services are custom made according to user and they offer browsing the content as per our need. We can publish a similar functionality as API’s. When an application wants to play an audio, here comes the role of audio API but that doesn’t decide the route through which it plays the audio like microphone, Bluetooth aur device audio. We don't need to reinvent the whole wheel we just need to use the features of it.

For Weather data we use a API called OpenWeatherMap. A Gist was shown by the speaker where Curl commands were given for easy understanding of the API’s calling and command line utility Curl.

Weather API

curl --location --request GET 'https://api.openweathermap.org/data/2.5/weather?q=mumbai&units=metric&appid=8cbce2bf9c96ba7df25eb3bdcd9c5e87'

**What is Postman? Postman is a collaborative API development platform that simplifies creating, using, and testing APIs with a UI. It is platform which segregates the tasks according to user’s convenience. Then next ahead the speaker Mr. Wilfred guided us to installation on Postman for the ones who haven't yet already. A collection was prepared titled as “Postman Collection” on the Gist document wherein the page redirected the user to the postman portal for interaction. He showed the procedure to fork the collection and edit the document of weather API. The API was user friendly and customizable when user sends the request and gets the response of the weather condition according to the location. Query Parameters were passed in the URL and send for data fetching. Duck API was called with Query and Curl utility command lines on git bash and we could see loading successfully the pictures. The features of Postman such as Downloading time and size and loading of picture was also shown with easy understanding.

Making Requests

The three ingredients to make a request:

Method (GET, POST, etc)

Address/Endpoint (URL)

Path

Requests — Methods and Endpoints The speaker very well explained the URL split up with all relevant meanings in it. He also explained various methods of requests calling such as GET, POST, PUT/PATCH, DELETE. We got to know about header requests and types of responses the user is expecting. How to host them and queries are customized according to user’s need. All of it were very well explained by the Speaker.

Receiving Responses

Response elements

Status codes (200 OK, 201 Created, 404 Not found) Headers Accessing body data 200 code is for successful request, 401 is for unauthorized, 404 is for Not Found and error-based URL’s. There are various data types through which requests can be sent such as

  • form data
  • JSON
  • text
  • HTML
  • XML
  • files
  • GraphQL … and more!

Apart from all these insights, we get to know about Certification programs of Postman and how one can earn one. Features were also shown which adds on to the beginners to learn with ease and maintain the hosting stuff with less pain. Collaborative environment can also be made using the features shown. Later, we got to know about Student Expert Program ran by Postman and what all learning it has got to offer.

> Thank you for the great session and benefitting us with learnings of Postman and API’s.

Here’s the link to Session : APIs-101-with-Postman