An API is like a contract between a client and server. If either interface changes, typically on the server side, the contract fails. However, APIs need to evolve, as new features get added and old ones get deprecated.
Hence, the API versioning is a key design decision taken early on in an API lifecycle. There are several popular API versioning implementations:
- URI versioning: Prefixing the URI with the version number, such as http://example.com/v3/superheroes/3 . This is a popular method but violates the principle that each resource has a unique URI across versions.
- Query string versioning: Appending the URI with a query string specifying the version, such as http://example.com/superheroes/3?version=3 . Technically, the URI is ...