Recall & Review
beginner
What is API versioning and why is it important?
API versioning is a way to manage changes in an API over time. It helps keep old clients working while allowing new features or fixes in newer versions.
Click to reveal answer
beginner
Name three common API versioning strategies.
1. URI versioning (e.g., /v1/resource)<br>2. Query parameter versioning (e.g., /resource?version=1)<br>3. Header versioning (using custom headers like 'Accept-Version')
Click to reveal answer
beginner
How does URI versioning work in an API?
URI versioning adds the version number directly in the URL path, like /api/v1/users. This makes it clear and easy to route requests to the right version.
Click to reveal answer
intermediate
What is a benefit of using header versioning over URI versioning?
Header versioning keeps URLs clean and lets clients specify the version in request headers, which can be more flexible and hides version details from the URL.
Click to reveal answer
intermediate
What is a drawback of query parameter versioning?
Query parameter versioning can be less visible and sometimes caching systems might ignore query parameters, causing unexpected behavior.
Click to reveal answer
Which API versioning strategy places the version number in the URL path?
✗ Incorrect
URI versioning adds the version directly in the URL path, like /v1/resource.
What header might be used for header-based API versioning?
✗ Incorrect
Custom headers like 'Accept-Version' are used to specify API version in header versioning.
Which versioning strategy can cause issues with caching if not handled properly?
✗ Incorrect
Query parameters might be ignored by some caches, causing stale or wrong responses.
Why is API versioning important?
✗ Incorrect
Versioning lets you improve your API while keeping old clients working.
Which versioning method keeps URLs clean and hides version info from the URL?
✗ Incorrect
Header versioning uses request headers to specify version, keeping URLs clean.
Explain three common API versioning strategies and when you might use each.
Think about how the version appears in the request and what clients see.
You got /4 concepts.
Describe why API versioning is necessary and what problems it solves.
Imagine you change your app but some users still use the old one.
You got /4 concepts.