Creating repeatable tests
Another important factor for creating good test automation is having repeatable tests. This means that you can run the test multiple times in a row and get the same result. With API testing, this is usually not a problem when testing GET requests, since they should be idempotent. You do need to be careful if you are sharing variables between tests, but usually, GET requests are naturally set up to be repeatable.
Other types of tests, like those testing POST or DELETE calls, might need a bit of thought to ensure that they are repeatable. For example, let’s think about testing a DELETE request. If you are testing with a testing or staging environment, you might already have data in there that you can use for testing purposes. It might be tempting to test a DELETE call by pointing at a resource that you know is already set up on the testing server, but will that be repeatable? Once you have deleted the resource, it is gone from the testing server...