Should version number come before or after the api name in the URL?

https://{Platform}/{version}/api_name/{resources}

OR

https://{Platform}/api_name/{version}/{resources}

Which one makes more sense? In option one version number comes first in the URL so that it has highest scope. Is it right way to do?

Thanks,

Krish

0 3 1,903
3 REPLIES 3

Great Question @Krish ,

I prefer https://{Platform}/{version}/api_name/{resources} , What ever you use be consistent across the API Program.

Brian Mulloy articles here talks about same,

  • Specify the version with a 'v' prefix. Move it all the way to the left in the URL so that it has the highest scope (e.g. /v1/dogs).
  • Use a simple ordinal number - v1, v2, and so on. Don't use the dot notation like v1.2 because it implies a granularity of versioning that doesn't work well with APIs--it's an interface not an implementation.
  • Make the version mandatory.

@Anil Sagar Any reason why do you prefer this?

@Krish , See an excellent post here by brian mulloy which talks about same.