How to (and how not to) design REST APIs · stickfigure
github.com/stickfigure/blog/wiki/How-to-%28and-how-not-to%29-design-REST-APIs
What Jamie wrote
Schnitzer with design suggestions for REST APIs. This is pretty straightforward, and I that it stays pretty simple and has a clear focus on usability.
- DO use plural nouns for collections
- DON'T add unnecessary path segments
- DON'T add .json or other extensions to the url
- DON'T return arrays as top level responses
- DON'T return map structures
- DO use strings for all identifiers
- DO prefix your identifiers
- DON'T use 404 to indicate "not found"
- BE consistent
- DO use a structured error format
- DO provide idempotence mechanisms
Of all of them, I think 9 is one of the most important.