Appetizer: How To Never Go Hungry with APIs 🍉

JJ Tang
API Connect Test & Monitor
3 min readNov 7, 2018

Using API Connect Test and Monitor — this tutorial will demonstrate how you can pinpoint down a list of places to eat so you never have to go hungry again.

To do this, we will be using the free Zomato APIs and construct an integration test via the tools drag-and-drop visual composer (with no code required, unlike Postman or SoapUI 😬).

Importance of integration testing? This will simulate customers (in this case, us) real-world usage of the APIs vs. just testing a single endpoint to see if it works. Without validating the end-to-end flow, it is difficult to catch if anything will break downstream. When it comes to food, it is critical we get it right.

Prerequisites 🔨

  1. API Connect Test and Monitor — sign up for your free-forever account here: https://ibm.biz/apitest.
  2. Zomato API — sign up for your free Zomato developer account. You will need to click Generate API Key, sign up (Google, Facebook, or email), and finally activate your account. The first 1,000 API calls/day are free of charge.

1. Make an API Call ☎️

Now you are ready to go. Go ahead and log into API Connect Test and Monitor. The first screen you are seeing is the Client — this allows you to send simple and advanced API requests.

In our tutorial, we will be using the Client to do a GET request. Specifically a GET request to find our city of interest, in our case, that will be Toronto.

Take the following URL: https://developers.zomato.com/api/v2.1/cities and paste it into the “Request url” input. Next, click “Params” to add a parameter. Add q as your “key” and Toronto as your “value”. Now, under “Headers” under “key” input user-key and for “value” input your own unique key generated from Zomato earlier 4fb2220d02f259843a91db67f9bf5acd . You are ready to hit Send, it should look like this.

Documentation for the /CitiesAPI can also be found in the Zomato documentation if you want to reference back.

Hit Send, and you should see the following in your Response body. Note on the right your HTTP Code is 200 confirming it was a good request. If you scroll through the response you can see that there are many places with cities named Toronto.

Now that we have confirmed that our cities API is returning a good response, we need to take it one step further. We are looking for Toronto, Canada, not anywhere else.

To do this, we need to generate an integration test and chain a series of APIs that Zomato offers together, not just the Cities API.

What’s Next? Dessert 🤤

In the next part of the tutorial we will show you how to generate an integration test and chain a series of APIs in our tutorial titled the “Dessert: How to Never Go Hungry with APIs 🤤”.

See you there! (yes, we skipped main course and went straight to dessert!)

We hope you found value in this tutorial. Please let us know in the comments what you would like to see next time!

Made with ❤️ from the IBM API Connect team.

--

--