API First
Design your API before you implement it in production
Maybe even write a prototype to test major use cases
Just like we do right now with the platform rebuildThink of resources
REST APIs are modeled around HTTP Verbs (which are fixed)
And you define the resources
Resources are mostly collections
For example if we want to get the orders of johndoe
And if we want to add an item ...
POST /accounts/johndoe/orders
To boldly noun where no verb is allowed
How would you model transferring money from one bank account to another?
Keeping the RESTful paradigm sometimes is weird, but adds consistency
POST /bank-accounts/johndoe/transactions
Styling Conventions
- use Swagger for API documentation
- HTTP Headers Hyphenated-Pascal-Case
- Query parameters & JSON fields snake_case
Coder Dojo
RESTful API Design
slides by Holger Schmeisky / @hschmeisky