Create Your First API Monitoring Test

API Monitoring helps you evaluate the performance of your API from the API consumer point of view, in addition to monitoring the uptime and correctness of your API.

An API test is a group of one or more HTTP requests executed sequentially. For each step in the test, you can define Assertions to validate response data and Variables to extract data to be used in subsequent requests. A test Passes if all the assertions pass. A test Fails if any assertion fails, or another error is encountered, such as a network connection problem.

You can run tests from the cloud or from behind your firewall against any public or private API. To use tests for ongoing monitoring, configure a schedule. After a test run completes, notifications can be sent via email, Webhook, PagerDuty, Slack, and more.

Create Your First Test

Follow these steps:

  1. Add a Request Step
  2. Define Assertions
  3. Run your Test

If you haven't yet, sign up for your free BlazeMeter account. After completing the tutorial, start by creating a new test (or API Tests > Create Test). You can name the test anything you like.

1. Add a Request Step

After you create a test, you will see an HTTP request step with a sample URL was automatically created and added to your test:

New HTTP request

Our sample URL is guaranteed to return a 200 OK status code. Later on, when building your own tests, you can define requests with your own methods, URLs, headers, parameters, or body content.

2. Define Assertions

Define expected response data.

Follow these steps:

  1. Expand the request to view details.
  2. Select Assertions.
  3. Add the following assertions (we created one for the status code automatically):
    Sample API test assertions

The assertions are evaluated after the request is executed for every test run. If any assertion fails, the test will fail. For your tests, you can create assertions that check response time, JSON or XML content, HTTP response headers and more.

3. Run Your Test

Click Save & Run to start a new test run. The request is executed and when complete, each assertion will be checked. You should see that the test run Passed. Select the test run from the results list to view the full HTTP request, response and test output.

Next Steps