One of the unique features of the API Science platform is the capability to create multi-step API monitors, wherein multiple API calls are chained together into a single monitor. If your product requires multiple API calls in order to produce the result you deliver to your customer, you could create a collection of standard single-call monitors. This will provide useful information. However, a multi-step monitor that replicates a typical calling sequence based on a user’s button click may provide an improved representation of your product’s chained latency, performance, and historical uptime.
In this post, we’ll create a simple API Science multi-step monitor. To get started, on your API Dashboard page, click the “Add Monitor” button:
This brings up the create monitor page:
In my post Creating Your First API Science API Monitor, we used the World Bank’s Countries API to create a monitor that checks the performance and uptime of calls to get the information for Brazil. But, what if your product requires the World Bank’s information for the so-called BRIC nations (Brazil, Russia, India, China)?
In this case, you’ll have to make four calls to the Countries API, one for each BRIC country (the API does not presently support requests for a list of countries). We can name the monitor “World Bank BRIC,” add the URL for Brazil, and specify running the monitor from Ireland as our starting point:
Saving the monitor brings us to the monitor summary page:
The monitor now gets the country information for Brazil. The “Add Step” button enables us to add the calls to the Countries API for Russia, India, and China. Clicking “Add Step” brings us to a page that’s similar to the initial create monitor page, only now the page asks us to “Create call #2 in monitor World Bank BRIC”:
Here, we’ll enter the URL for obtaining the Countries API information for Russia:
Clicking “Save Monitor” brings us back to the “World Bank BRIC” monitor summary page. We click the “Add Step” button to add the Countries API call for India (two-letter code IN), and when that step is completed we click “Add Step” one more time to add China (two-letter code CN). Saving the monitor brings us to our complete “World Bank BRIC” monitor summary page:
The checks took longer to complete as we added API calls for more countries.
Now, we’ve created an API monitor that measures the performance of chained calls to the World Bank Countries API to obtain the information for the BRIC nations. This is different information from what you’d have if you configured four separate monitors measuring the performance and uptime of calls for the individual countries. If your product presents the information for the BRIC nations, you need to know the cumulative performance and uptime of the full sequence of calls to the World Bank Countries API.
API Science’s multi-step API monitoring facility uniquely provides this capability.