Did you develop an API using best practices?

Review your API in less than 5 minutes

David Castro
2 min readFeb 22, 2022

--

Cornershop by Uber

In Cornershop by Uber we use and create a lot of APIs, and no matter how advanced you’re it’s always key to check if you’re using all the best practices according to industry standards, that’s why we came up with this short and concise list

✔️ Checklist

  • [ ] The API has defined authorization and authentication schemes
  • [ ] The API makes correct use of HTTP verbs (GET, POST, PUT, PATCH, DELETE).
  • [ ] The API has a clear definition of the endpoints. This definition includes: What it does and how it relates to other endpoints.
  • [ ] The API has quality documentation containing the structure of the responses, the methodology of each endpoint, the description of each endpoint, and example use cases
  • [ ] The API has a response structure for error handling and uses error codes correctly (4xx or 5xx errors)
  • [ ] In the API design, an accurate modeling of sources was performed, taking into account the REST API principles
  • [ ] The API uses nouns in the names of resources e.g., /posts
  • [ ] The API uses plural nouns in the endpoints or URLs e.g., /posts
  • [ ] API avoids deeply nested sources, e.g., /posts/r83fj3/comments/users/35
  • [ ] The API uses non-sequential resource identifiers, e.g., /posts/r83fj3
  • [ ] The API does not utilize custom actions on its endpoints, e.g.: POST /posts/d92hf73/publish This goes against REST principles.
  • [ ] The API has some defined structure for responses, e.g. JSON API, or one that is internally defined
  • [ ] The API correctly utilizes HTTP response codes, e.g. if you are create a resource, use 201 code in the response.
  • [ ] The API uses a version control
  • [ ] The API has basic security principles, such as request rate limits
  • [ ] The API has a support section for developers
  • [ ] The API has filterable, sortable, and pageable collections (In Cornershop by Uber we strongly recommend that your responses are paginated)
  • [ ] The API has an obsolescence policy

--

--

David Castro

🚀 Software Engineer 🖥️ Backend Developer 🐍 Python & Django http://davidcasr.co/