Digital Transformation

How to do API Versioning

1- URL based versioning

Easy and very common way to version api is to include version no in api url.
For e.g. http://myapi/v1.0.0 , http://myapi/v1.0.1

  • Easy to use and identify different version by looking URL.
  • Over time need to maintain various urls

2- Using query param

Covid 19
COVID-19: Digital Insights For Enterprise Action

Access Perficient’s latest insights into how you can leverage digital technologies to not only respond to the pandemic, but drive your operations forward and deliver experiences your customers need.

Get Informed

Another easy to use startegy for api versioning
For e.g. http://myapi?version=1.0.0

  • Same url for different api version
  • Need to add tranformation logic to route to particular version

3- Using custom HTTP header

Slight advantage over approach #2 since this will keep url short.

  • same url for different api version
  • Need to add tranformation logic to route to particular version

4- Using Accept HTTP Header

For e.g. Accept:application/v1.0.0+json , Aceept:application/v1.0.0+json

Slight advantage over approach #3 since no need to add new custom header.

  • Same url for different api version
  • Need to add tranformation logic to route to particular version
About the Author

More from this Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up