I have a REST-ish API that returns JSON. One of the output fields is status
, which indicates if the call succeeded. I gather that it's somewhat standard to use numeric status codes such as
200 success
400 syntax error
401 authentication error
402 general error
404 user not found
408 timed out
500 fatal error
501 not yet implemented
Are there any reasons (other than to transmit slightly fewer bytes) to use numeric codes rather than more descriptive symbols as the status, like
success
syntax_error
auth_error
general_error
user_not_found_error
time_out_error
fatal_error
not_yet_implemented_error
Pointing to modern precedents in well-respected APIs would be helpful.