top of page
lp.jpeg

Blog

Tags:

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:


Diagram defined in Part 1, which contains the 4 aspects of the API + the Implementation.

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.”