Daily Shaarli

All links of one day in a single page.

June 13, 2022

How to design better APIs
  1. Be consistent
  2. Use ISO 8601 UTC dates
  3. Make an exception for public endpoints instead of
  4. Provide a health check endpoint: GET /health
  5. Version the API
  6. Accept API key authentication
  7. Use reasonable HTTP status codes
  8. Use reasonable HTTP methods
  9. Use self-explanatory, simple names: Most endpoints are resource-oriented and should be named that way.
  10. Use standardized error responses (the same error structure)
  11. Return created resources upon POST
  12. Prefer PATH over PUT: full update of a resource is rare
  13. Be as specific as possible
  14. Use pagination
  15. Allow expanding resources