API API Documentation and Design 2 — Questions and Answers
Question 1: What is HATEOAS in REST API design?
- A security protocol
- Hypermedia as the Engine of Application State — embedding navigation links in responses (Correct answer)
- A caching strategy
- An error handling pattern
Correct answer: Hypermedia as the Engine of Application State — embedding navigation links in responses
HATEOAS is a REST constraint where API responses include links to related actions, allowing clients to navigate the API dynamically.
Question 2: What is the purpose of an API changelog?
- Tracking server uptime
- Documenting version history and breaking changes for API consumers (Correct answer)
- Logging all API requests
- Recording test results
Correct answer: Documenting version history and breaking changes for API consumers
An API changelog documents what changed between versions, especially breaking changes, so consumers can plan upgrades.
Question 3: What is a 'deprecation notice' in API design?
- An error response
- An announcement that an API feature will be removed in a future version (Correct answer)
- A security warning
- A performance alert
Correct answer: An announcement that an API feature will be removed in a future version
A deprecation notice warns API consumers that a feature or endpoint will be removed, giving them time to migrate.
Question 4: Which HTTP response header can indicate a deprecated API endpoint?
- Content-Type
- Deprecation (Correct answer)
- Cache-Control
- Authorization
Correct answer: Deprecation
The Deprecation header (RFC 8594) is a standard way to signal that an API endpoint is deprecated, often with a sunset date.
Question 5: What is an API sandbox environment?
- A restricted production environment
- A safe environment for developers to test API integrations without affecting production (Correct answer)
- A sandboxed browser for testing
- An offline documentation viewer
Correct answer: A safe environment for developers to test API integrations without affecting production
An API sandbox is an isolated test environment that mimics production, allowing developers to test integrations without real data or side effects.
Question 6: What does 'backward compatibility' mean in API design?
- The API works with older browsers
- New API changes don't break existing client integrations (Correct answer)
- The API supports older HTTP versions
- Documentation can be read in reverse
Correct answer: New API changes don't break existing client integrations
Backward compatibility means new API versions continue to work correctly with clients built against older versions.
What is HATEOAS in REST API design?