4. * min {control on usage}
* max {responsibility}
* decisions.exist {_.takeAtDay1}
* min {control on usage}
* max {responsibility}
* decisions.exist {_.takeAtDay1}
9. Be consistently
consistent
* HTTP methods
* HTTP codes
* Headers
* Authentication
No one likes surprises
Make your users feel at home
Use Standards:
Error handling
10. It is all about the
Expectations
GET
POST
PUT
/customers/{id}
/customers
/customers
REQUEST RESPONSE
customerGET
customercustomer
customercustomer*
200
201
200
13. Can we have
both ?
To embed || !to embed ?
Simple
All you need in one request
Fewer transactions
Simple
All you need in one request
Fewer transactions Fast
Building block
flexibility
Cacheable
Fast
Building block
flexibility
Cacheable
!to embed
to embed
and do it right ?
*
14. Yes We Can !
GET /customers/1
GET /customers/1?embed=orders
24. “Authorization”
“privacy” , your privacy
“Authorization”
“privacy” , your privacy
Bi-Directional mapping using secret key
HOW?
Tip #2
Add another column in the DB
27847321845
69
1
26. ===>
GET /customer/1 HTTP/1.1
Accept: application/outbrain.customer-v2.5+json
===>
GET /customer/1 HTTP/1.1
Accept: application/outbrain.customer-v2.5+json
<===
HTTP/1.1 200 OK
Content-Type: application/outbrain.customer-v2.5+json
<===
HTTP/1.1 200 OK
Content-Type: application/outbrain.customer-v2.5+json
Like a version
27. – One ?
– Three ?
– Four ?
– One ?
– Three ?
– Four ?
Quiz #3
How many Types do you need ?
GET /customer/1
PUT /customer/1POST /customer/1
28. Clones ? Not Really !
!= Internal Model
Retrieve != Update != Create
29. JSON 2 Case Class [Scala]
http://json2caseclass.cleverapps.io/http://json2caseclass.cleverapps.io/
.json
.scala
32. “Boss, Boss
his API is not RESTful”
But his API
is level 3 on
RMM
evaluating RESTFulness
33. 0 – One URI One verb
1 (Resource) – multiple URIs One verb
2 (Verbs) – multiple URIs multiple verbs
3 – Hypertext As The Engine Of Application State
0 – One URI One verb
1 (Resource) – multiple URIs One verb
2 (Verbs) – multiple URIs multiple verbs
3 – Hypertext As The Engine Of Application State
Rest Maturity Model
steps toward the Holy Grail of REST
36. Much more to talk about
* metrics and monitoring
* Internal and Public API
* Rate Limit
* metrics and monitoring
* Internal and Public API
* Rate Limit