This seems fairly straight-forward, you ask a question and you get a response along with a code on how to interpret that response. However, if you have ever built an application or Web site using multiple APIs and Web services, especially from different vendors, you know that there are very few steadfast rules around what these various response codes can be. This means new levels of complexity can be introduced into Web applications when having to create code and logic to handle all of the various response codes your application might receive from various external service calls. This is counter-intuitive because the whole point to using external services in the first place is to reduce complexity and make things simpler, not create new complexity.
For example, the simple response code from a data service of data not being found in response to a query on the Web today includes variations such as “0”, “error 100”, “404”, the “data not found” string, nothing at all being returned, and probably about a thousand other possibilities. These responses must all be anticipated and understood by the consuming application. A programmer (or a business user) that must incorporate all of these differing responses into an application, Web site, third party application, or mashup is facing a tall order.
One of the things we have done at StrikeIron to alleviate this burden is to ensure that all of the various response codes returned from our commercial Web services are consistent across all of these services, significantly reducing complexity for anyone putting them to use.
For example, StrikeIron APIs will return a Status Code of 200 for all successful invocations. Here are some other basic examples of status codes that are consistent across all services.
* StatusNbr = 200 StatusDescription = Found
* StatusNbr = 300 StatusDescription = Not Found
* StatusNbr = 500 StatusDescription = Internal Error
Of course, each service has its own range of service-specific response codes that fall within these number ranges (such as carrier not found for sending an SMS message, or invalid zip code for an address verification), but you will find consistency in these responses as well. You can check the documentation (or invoke the status code methods within the service) for a full list of response codes for any given StrikeIron service.
The general idea is that this consistency makes it easy to move from one API to the next while minimizing any amount of learning curve, and getting us all closer to the to the goal of reduced complexity we are all trying to get to in the first place.
Recent Comments