This article provides you the step-by-step instructions on how to use the ready-made and fully functional examples when creating a Multi-step API (MSA) monitor.
These examples use the Uptrends Galactic Resorts API as a fictional API site to retrieve space travel destinations. All examples can be tested right away and later on be configured for your specific monitoring needs.
Simple example
The Simple example lets you create a pre-configured monitor with a single API call, referred to as a step. In this step, the monitor performs a GET request to the https://galacticresorts.com/api/Destinations
endpoint. The
API response is then validated to check if the status code is 200, load time is less than 25,000ms, and the first price from the JSON response[0].Price
is greater than 10.
Select any option from the product tour to start interacting with the demo:
Two API calls + console output
The Two API calls + console output example lets you create a pre-configured monitor consisting of two API calls, referred to as steps, and prints a value in the console.
In the first step, the monitor performs a GET request to the https://galacticresorts.com/api/Destinations
endpoint. The
API response is then validated to check if the status code is 200 and if the load time is less than 25,000ms. Additionally, the value of the first Product Id
from the JSON response is stored in a
variable named ProductId
for the next step.
In the second step, the monitor performs another GET request and uses the value of the ProductId
variable to retrieve a specific product: https://galacticresorts.com/api/Destinations/{{ProductId}}
. From the response, two variables, ProductPrice
and ImageFileName
, are created to store the value of the product’s price and image file name.
Then, the monitor runs a
custom script in the Post-Response tab, which prints the value of the ProductPrice
variable to the console.
Select any option from the product tour to start interacting with the demo:
For more information, refer to How to set up Multi-step API monitors.