Rest-API - Add Status 20x for empty Results

3 votes

As a user, I am always uncertain when I get a "200" but no data in the value.

Please add a special code for empty results:
"201 OK: The operation was done successfully but did not produce any results”

In addition, you schould add a also a parameter to the query to indicate whether you want to retrieve the also the data or not. If you are not interested in the data itself, you can bypass the data transfer overhead and simply check the status code.

This would simplify the queries where you only want to know if something is found and do not need the data itself. As example when you whant to check whether a downtime has been set or not, you do not need to transfer all the downtimes just to know that there is one. A "200" would mean that there is at least one downtime and a "201" would mean that there is no downtime.

Under consideration RestAPI Suggested by: Lars Sörensen Upvoted: 09 Oct, '25 Comments: 0

Comments: 0