Articles about REST APIs versioning tend to describe three versioning methods
To include the version in the URL:
example.com/api/v1/myresource
To include the version in a header
To include the version in the content type
The application that I am building has two parts:
An interface that users can use to change settings that are stored in JSON format according to their needs.
An API that users can use to get resources and edit data.
The API is heavily dependent on the interface. In other words, if I changed the interface (e.g. renamed some JSON fields) the API could change its behaviour and even break.
All of those methods assume that the API version is not dependent of the interface since a user with any interface can use multiple API versions at the same time.
My question is how do you handle versions when your API is dependent on your interface?
The best solution that I came up with is to enable users to choose their version in the settings. By doing that I can serve the proper interface with its corresponding API method.
Best practices for API versioning? Described the three methods that I mentioned above. As far as I can tell they didn't talk about how to version an API that is dependent on the interface ( e.g. API v6 has to be used with interface v6 )