When designing the errors of a REST API seems to be a good practice to follow standard HTTP codes (4XX and 5XX) and to include a body (XML/JSON) with:
My question is ... shall these messages be internationalized?
I tend to think that showing a message to the client is client side responsability, and those API errors should be considered as an agreement (format, and code field) between the client app and the API but shall not be considered by default as perfectly suited to be exposed to the client directly, so formatting the final message "Ooops ... something was wrong, dude" shall be done at client side since words like "Ooops" and "Dude" makes no sense in the API. In other case i can see API deployments because P.O. needs to change "Oops" to "Uups" and things like that, that seems totally like something related to the look and feel of the client app IMHO.
Further if i include final specific messages in the API we can fail to be able to serve heterogeneous client systems since some of them may want "Ooops ... we screwed it up, dude" while others may want "We are sorry something was wrong, Mr. Client".
Do you agree with this? ... or i am missing something?
--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
Visit this group at http://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.
--
My question is ... shall these messages be internationalized?
--
But I do consider it good practice to include what the client send as this will help debugging. So it should be more like "1234 is too many items. You are only allowed a maximum of 1000 items".
--