Talk given to Sittercity Technology team explaining how to build modern APIs using emerging and existing standards. Covers content negotiation, versioning, error handling and authorization concerns when designing and implementing a modern API.
business rules or persistence Server is not concerned with state or presentation for humans Decouples components. Server and client implementations can be modified safely as long as the interface is maintained
quickly and easily – good for horizontal scalability Authentication and authorization must be provided with each request All information required to service the call must be passed with the request
Choices 301 Moved Permanently 302 Found 304 Not Modified 307 Temporary Redirect 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 410 Gone 414 Request URI Too Large GET
303 See Other ! 400 Bad Request 401 Unauthorized 403 Forbidden 405 Method Not Allowed 406 Not Acceptable 411 Length Required 412 Precondition Failed 413 Request Entity Too Large 414 Request URI Too Large 415 Unsupported Media Type POST
400 Bad Request 401 Unauthorized 403 Forbidden 405 Method Not Allowed 406 Not Acceptable 409 Conflict 411 Length Required 412 Precondition Failed 413 Request Entity Too Large 414 Request URI Too Large 415 Unsupported Media Type PUT
the latest version if no content type version is supplied ! must support hypertext application language compatible JSON ! should support other sensible content types ! must error using valid vnd.error+json responses ! should use cache control headers correctly ! must enforce authorization using RFC 6749 & RFC 6750 Sittercity machine interfaces…