Uptrends API monitors can check a single response or handle complex multi-step API calls. In this lesson, we go over the basics of setting up an API monitor.

What types of API monitors are there?

  • Webservice HTTP/HTTPS
    The Webservice HTTP/HTTPS monitors can test a single response. We recommend using Webservice monitors to check on the availability and uptime of an API using basic authentication and content checks. You'll find more information about Webservice Monitors in our Knowledge Base.

    Note: Visit the lesson on Availability Monitors to learn how to setup Webservice monitors, or visit our Knowledge Base for detailed information on Webservice monitors.

  • Multi-step API
    If you need to handle redirects, handle authentication, make multiple API calls, or you need to reuse values from one API call to another, you'll want to use a Multi-step API Monitor. Just keep reading, and we will give you the basic setup information, but you'll find more setup details in our Knowledge Base.

Add a Multi-step API Monitor

You may want to keep your API documentation handy during the setup process.

  1. Click the + Add Monitor button from Monitors on the Main Menu to open the New Monitor configuration screen.

  2. Select Multi-step API for the Type.

  3. Give your monitor a Name.

  4. Set the Check frequency.

  5. Switch to the Steps tab.

Okay, let's take a moment to talk about what we mean by a step.

What is a step?

A step in Multi-step API monitoring consists of one round-trip call to the API (i.e., one request and one response). Within each step, you can define your request and tell Uptrends how to handle the response. Each Multi-step API starts with one empty step. Let’s fill it up!

Setting up a request

When you switch to the Steps tab on your Multi-step API monitor, you see one step in the Steps column, but you’ll find both the Request and Response (on the right) empty for that step. Let’s change that.

Steps tab

The page defaults to the Request (right side column).

  1. Choose your HTTP Method and add the URL. The method defaults to GET, but, if you choose POST, PUT, or Delete, a text field appears where you can input your request body.

  2. Click Add request header to define your request header key and value ( learn more).
    Common headers include name/value pairs:

    - Accept paired with application/json or text/xml, or application/x-ww-form-urlencoded

    - Content-Type with application/json or text/xml, or application/x-ww-form-urlencoded

    - Authorization with the appropriate data in the Value field.

    Note: If you need to use the same value multiple times, you can add the value in the predefined variables section towards the bottom of the Steps screen. We’ve got more information on predefined variables in the Knowledge Base.

  3. Optionally, setup the Authentication, Client certificate, check the Ignore TLS/SSL certificate errors if you don’t want to get notifications about these types of errors, and give a Step description.

Handling the response

Once Uptrends sends the request, we need to know what you would like us to do with the response, so now let's look at your options for handling a response.

  1. Click the Response tab at the top of the column.

  2. Click Add assertion (learn more).

  3. Select the response type in the first box. Uptrends uses your choice here to set up the rest of the assertion fields. Go ahead and explore all the different types of responses you can choose. For your first assertion, how about checking the status code. You will have two more boxes to complete.

  4. Set the comparison operator. We want to make sure that the request was successful, so let’s choose “Is equal to.”

  5. Put the value you want to check for in the last box. In this case, we want to make sure that the request succeeded, so let’s set it to “200.”



  6. Continue adding assertions as you see fit. 

  7. Add any variables for values you may need to reuse by clicking the Add variable button. Set the response type, add the query or expression, and give your variable a name (learn how to define and use variables).

  8. Click Save if your monitor only needs to make one request, or you can continue adding steps using the + Add step button in the left column.

Note: We have extensive detailed instructions and examples in the API Monitoring section of the Knowledge Base.