concept Banking Company in category api

appears as: Bking Company, The Bking Company
The Design of Web APIs

This is an excerpt from Manning's book The Design of Web APIs.

Let’s say the Banking Company’s current accounts come with an optional overdraft protection feature. If the overdraft protection is active, the bank will not apply any fees in the event of the customer’s withdrawal exceeding the available balance. It could be interesting to know if this option is active or not when retrieving information about a bank account with the Banking API provided by this company. Figure 5.3 shows how it could be represented in the API.

A breaking change is a change that will cause problems for consumers if they do not update their code. As you’ve seen, these problems can also have repercussions on the provider’s side. If the Banking API’s consumers are third-party applications developed by other companies, introducing breaking changes to the API is definitely not an option. The consumers will break, and their developers will get upset, lose confidence in the Banking API, and possibly choose to use a competing API instead. Therefore, the Banking Company can lose money—if not worse.

But not all APIs are public ones, consumed by thousands of third-party consumers. If the Banking API were a private one, acting as a simple backend for a single-page application (SPA) as well as a mobile application built by the Banking Company itself, introducing breaking changes would be practicable. All that is required in this case is to update the SPA on the Banking Company’s web server hosting the SPA files and force an update of the mobile application, provided that this application includes a force update feature.

The day has arrived! The Banking Company has decided to launch version 2 of its famous Banking API. Figure 9.9 shows a possible scenario, among many others, to handle such a change.

Figure 9.9 The Banking Company has updated its Banking API to version 2.

09-09.png