Success Rules Success rules are the conditions of an endpoint to be considered as successful. When an endpoint runs and ApiSpotter gets a response from the API, there are many possibilities for that response to be marked as successful.

These are the main success rule types you can create:
  • Response Time Lets you create a rule about the response time in seconds. You can pick a condition and a value for the response time that we get from the API. For example, you can create a response time rule, select the condition "smaller than", and enter the value 5 to the input. And that test will be considered as successful if only the response time is smaller than 5 seconds.
  • Response Code Lets you create a rule about the response code we get from the API. Again you can select a condition and a value for the response code conditions.
  • Key Existence Rules Lets you work on the response you get from the server and mark a key from the JSON typed, key-value pair response from your API. The key you mark will become a rule of existence. For example, if you get a response from your API like {message:"Hello!"} and mark the "message" key as a success rule, the endpoint test will check for the "message" key's existance to be considered as successful on the next runs.

* The default success rule is a "Response Code is between 200 and 210" rule. If we get a response code between 200 and 210, the test is considered as successful, unless any response code rule is given.
* In the first run of every endpoint, the system doesn't check anything. The first run of tests are is considered successful unless a fatal response code, like 500, happens.