Referred many blogs and found that versioning api in url is a bad practise but most of the popular companies have their api versioning in their url?.. need to know the reason behind it and also the advantages of using version in url...please help me on this
Asked
Active
Viewed 122 times
0
-
1This is an interesting question and I think Shonzilla answered it best in his answer here http://stackoverflow.com/a/398564/846698 – Suhail Patel Nov 29 '13 at 10:59
-
actually i just want to know the reason why they prefer to version in url – SathishBabu Nov 29 '13 at 11:13
1 Answers
0
It is always better to keep the version in URLs as this will help api consumers to continue using your old api in case your api is upgraded or changed. When you have developed a new API, it is not wise to deprecate the old ones right away (it will break all hell loose) and let your users use the old url till they upgrade to your new apis.
Hope that will help.

techvineet
- 5,041
- 2
- 30
- 28
-
ok one more quick question on this if we version in accept header, will the client wont be able to access the older api? – SathishBabu Nov 29 '13 at 11:31
-
I don't think its a good idea. The Accept header tells the server what file formats, or more correctly MIME-types, the browser is looking for. Adding api version to it will be like keeping standards on stake – techvineet Nov 29 '13 at 12:00
-
-
Hey sorry i dont have enough credits to vote up...really sorry about dat...tried exploring the versioning through url but our api is based on the web application and render with respond_to...in versioning through url have to add namespace for api and version which will affect the web application...help me on this – SathishBabu Dec 02 '13 at 12:28