From the course: Designing RESTful APIs

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

API versioning best practices

API versioning best practices - REST Tutorial

From the course: Designing RESTful APIs

API versioning best practices

- [Instructor] Now, for the single most contentious and hotly debated issue in all of API design, versioning. While I value being semantically proper as often as possible, I've designed and built APIs for production usage at massive scale, both in terms of traffic and the number of people using it. So I will always push for clarity of purpose and ease of use more than anything else. There are two primary schools of thought here, versioning in the URL or versioning via the accept header. First, let's look at the accept header. When you make a request to an API, you should have the accept header, which tells the API these are the data types and the formats I understand, please send one of them. This is called content negotiation. At the first level, the data types could be as simple as XML versus JSON. That's where most APIs will begin and end, and that's acceptable as long as you can parse the result. At the next level…

Contents