API Design Best Practices
- What does REST stand for?
- Representational State Transfer
- REST APIs are designed around a __.
- What is an identifer of a resource? Give an example.
- an identifer is a URI that uniquely identifies that resource, for example, https://we-sell-things.com/orders
- What are the most common HTTP verbs?
- the most common operations are GET, POST, PUT, PATCH, and DELETE
- What should the URIs be based on?
- URIs should be based on nouns (the resource) and not verbs (the operations on the resource)
- Give an example of a good URI.
- Good: https://we-sell-things.com/orders
- Bad: https://we-sell-things.com/create-orders
- What does it mean to have a ‘chatty’ web API? Is this a good or a bad thing?
- a chatty web API means it requires a client application to send multiple requests to find all of the data that it requires
- this is a bad thing and should avoid it
- What status code does a successful GET request return?
- What status code does an unsuccessful GET request return?
- What status code does a successful POST request return?
- What status code does a successful DELETE request return?
more on APIs
<==Back