Understanding APIs (Part 5): Intro to Postman and Query Parameters

Part 5 already! What a trip it’s been. :)
Let’s recap what we have learned so far:
Understanding APIs (Part 1): What is an API? - We defined the initial diagram.
Understanding APIs (Part 2): API Analogies and Examples - We talked about the Restaurant and Calculator analogies and looked at the Human Resources API example.
Understanding APIs (Part 3): What are HTTP Methods? - We learned the 5 most popular HTTP methods: GET, POST, PUT, PATCH, and DELETE.
Understanding APIs (Part 4): What is a URI? - We learned that a URL is just a form of URI. We broke down a URI into protocol (HTTP/HTTPS), host, and path.

Continuing with the last topic, URIs, we will now get started using Postman and learning what Query Parameters are.
Getting started with Postman
You can download Postman for free from their website. Once you have it, open it, and it will look something like this:

Now let’s click on the plus (+) button as indicated below.

This will open a new Untitled Request. Let’s paste the following URI into the text box that says “Enter request URL” -
https://official-joke-api.appspot.com/random_joke
Now click on “Send.” You should be able to see a formatted Response similar to this:

Note: If the Response appears at the bottom of the screen and not on the right, you can change Postman’s layout by going to Postman preferences (or settings) > General tab > Check that the User Interface is set as Two-pane view.
Congratulations! You just made a call to the Joke API using Postman.
What are Query Parameters?
Query Parameters (also known as Query Params), which are appended to the URI, are fields that are used to send additional information or data to the API. They are usually used to filter or search for data. For example, if you want to search for “cats” from Google, you can simply use this URI: https://www.google.com/search?q=cats. Let’s break down this URL like we did in the last post.

In this case, there’s only one Query Param, which is named “q,” and the value we’re sending is “cats.” For Google, when you call the path “/search” and attach the “q” Query Parameter, it knows that you want to perform a Google search with the word “cats.”