10 ms·
Many moons ago I worked with a system like this. An XML based API that returned 200 because "the server and/or service isn't broken" but the body would contain
by lapser 4y ago
Many moons ago I worked with a system like this. An XML based API that returned 200 because "the server and/or service isn't broken" but the body would contain errors.
I understand what the owner of the API is trying to convey. "My service is up, and the URL itself exists" (status 200), but in the body "the data you requested doesn't exist" (result: true, error: "doesn't exist). If you are stubborn enough, you can even think you're right.
But by Odin's Beard this was one of the hardest APIs I had to work with. It doesn't help that most HTTP clients assume a sane* API expecting error codes based on the resources.
Note: I say sane, but within this context, this is of course subjective. For me, error codes corresponding to the resources is sane, but to OP this is clearly not the case.