Upgrade to Pro — share decks privately, control downloads, hide ads and more …

api-design-practice.pdf

to4iki
September 07, 2014

 api-design-practice.pdf

to4iki

September 07, 2014
Tweet

More Decks by to4iki

Other Decks in Programming

Transcript

  1. 1. ಈࢺͰ͸ͳ໊͘ࢺ ɾϦιʔεΛ໊ࢺͰද͢ collectionͰ υϝΠϯʹΑͬͯ͸ಈࢺ΋͋Γ /convert?from=EUR&to=CNY&amount=100` ɾHTTP ϝιουΛϦιʔεͷૢ࡞ͱ͢Δ get, post,

    put, delete ɾ֊૚͸ͳΔ͚ͩઙ͘อͭɺγϯϓϧʹ /users/5678/dogs /resource/identifier/resource ͕໨҆ ɾURLʹϝιουΛؚΊͳ͍ /users/show/123ͱ͔ → /users/123 ɾෳࡶ͞͸ΫΤϦύϥϝʔλʹԡ͠ࠐΉ /users?q=hoge&offset=50&limit=30
  2. 6. ֎෦Ωʔͷࢀষ͸ωετ͢Δ    "name":"fute",      "ownerId":  “13524-­‐...",   !

    Ͱ͸ͳ͘   !    "name":"fute",      "owner":  {          "id":  "13524-­‐...",      }   Ϩεϙϯεͷߏ଄Λมߋͨ͠ΓɺτοϓϨϕϧͷϑΟʔ ϧυΛ௥Ճ͢Δࣄͳ͘ɺؔ࿈৘ใΛؚΊΔࣄ͕Ͱ͖Δ