REST API Versioning. Is there a way to do it and what would be the best option?

3

I currently develop APIs for integrating internal services with our company and in the near future we will have the opportunity to make available some of our APIs to external partners.

Suggest the idea of an API versioning in a team brainstorm.

Currently I'm against versioning the API, but reading more about it and understanding the motivation of the team in versioning the API, I ask. Is there a better way to version an API? Is it a good idea to version the API? I think of focusing on a "contract" wiki defining both the API and the inputs and outputs or even an excel would give the message.

I've already heard of versioning on the resource path, the Accept header, and a custom header version or something. What is your experience in this matter?

    
asked by anonymous 26.10.2016 / 11:41

1 answer

4

You may be making use of a system to manage your versions in the case GIT or SVN , we can assume that the structure change of an api is a new branch and so you can control over the code change and the versions of your application.

To make it available to your customers, you can use subfolders or subdomains. Example% with%,% with%. I would do with subfolders, api-v1.meusistema.com.br , api-v2.meusistema.com.br but there goes from each one do what you like best to do the maintenance.

You can look at how other companies work and build on how they make the API available.

The Moip , for example, controls folders, eg meusistema.com.br/api-v1 or meusistema.com.br/api-v2 .

    
23.06.2017 / 15:28