Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Apiconf - The perfect REST solution

167 views

Published on

The key points for API development and management.

Published in: Internet
  • Be the first to comment

  • Be the first to like this

Apiconf - The perfect REST solution

  1. 1. The perfect REST Solution Gabriele Mittica - @gabrielemittica
  2. 2. What is REST? APICONF 2017- Gabriele Mittica
  3. 3. APICONF 2017- Gabriele Mittica REST Uniform Interface Stateless Cacheable Client Server Layered Code on Demand
  4. 4. REST HTTP APICONF 2017- Gabriele Mittica
  5. 5. A REQUEST is a set of Header and Body with a specific VERB (action) against an URI (resource) Header Body Verb on Uri REQUEST
  6. 6. HTTP VERB ▪ POST: creation ▪ PUT: update ▪ GET: retrieve ▪ DELETE: cancellation ▪ POST+PUT+GET+DELETE = CRUD ▪ PATCH (optional): partial update APICONF 2017- Gabriele Mittica
  7. 7. A RESPONSE is a set of headers and body that returns a specific status code to the client Header Body Status RESPONSE
  8. 8. APICONF 2017- Gabriele Mittica
  9. 9. APICONF 2017- Gabriele Mittica
  10. 10. Create the perfect url ▪ POST http://www.example.com/customers ▪ GET http://www.example.com/customers/33245 ▪ POST http://www.example.com/customers/33245/orders APICONF 2017 – Gabriele Mittica
  11. 11. Don’t be an artist! Don’t do that: ▪ GET http://api.example.com/services?op=update_customer&i d=12345&format=json ▪ PUT http://api.example.com/customers/12345/update APICONF 2017 – Gabriele Mittica
  12. 12. Use headers and body in the right way RIGHT [ {…}, {…}, {…}, {…} ] //pagination in header WRONG { ‘’pagination’’: { ‘’from’’: 0, ‘’to’’: 10}, ‘’data’’: [ {…}, {…}, {…} ] } APICONF 2017- Gabriele Mittica
  13. 13. In few words ▪ Work on resources ▪ Use headers, body and query params in the right way ▪ Find the best auth method for your needs ▪ Design layered APIs APICONF 2017- Gabriele Mittica
  14. 14. Be simply REST Thanks for Listening

×