-
Order (number, date)
- has one Customer
- has one or more Items
- has zero or more Tags
-
Customer (number, name, country)
-
Item (number, product, quantity)
- Items exist only within Orders
-
Tag (name, description)
- Be consistent.
- Utilize HTTP features (verbs, status codes, headers).
- Use hypermedia.
- Define filtering, sorting and pagination on collections.
- API endpoints should return:
- a single resource or ...
- a collection of resources or ...
- an error (or redirect) and ...
- nothing else!
- Identifying resource
- Specifying operations
- Considering query parameters
- Defining status codes
- Specifying headers
- Choosing data representation
REST API Design - practice
By Ivan Novakov
REST API Design - practice