When Zabbix database is down, any api request correctly fails with a json error message (before 2.2, the error was not json, but just HTML, it was fixed in 2.2.x).
However the error message misses the "data" property:
while the API documentation ( https://www.zabbix.com/documentation/2.4/manual/api) states that:
"If an error occurred, instead of the result property, the response object will contain an error property with the following data:
- code - an error code;
- message - a short error summary;
- data - a more detailed error message."
so either the documentation needs to be updated or the error in this case, should also contain a "data" property.