Notes on Designing APIs.
- Collection of resources
- URL Endpoints.
“The paths should contain the plural form of resources and the HTTP method should define the kind of action to be performed on the resource.”
- HTTP Response Codes.
2xx Success. 200 Okay. 201 Created. 204 No content.
3xx Redirection. 304 Not Modified.
4xx Client Error. 400 Bad Request. 401 Unauthorized. 403 Forbidden. 404 Not Found. 410 Gone.
5xx Servor Error Category. 500 Internal Server Error. 503 Service Unavailable.
- Casing Convention.
- Searching, sorting, filtering and pagination.
“We need to append the query params with the GET method API.”
“When your APIs are being consumed by the world, upgrading the APIs with some breaking change would also lead to breaking the existing products or services using your APIs.”
“http://api.yourservice.com/v1/companies/34/employees is a good example”