際際滷

際際滷Share a Scribd company logo
HTTP/1.1!
Server:!
200 OK!
nginx!
Date:"Wed, 14
Content-Type:!
Sep 2014 14:03:33!
application/json;!
GMT!
charset=utf-8!
Connection:
Status: 200!
keep-alive
OK!
ETag:! "ef742caec0c19e2169ffb05e7d200d17"!
Last-Modified: Sat, 13 Sep 2014 10:52:21 GMT!
{!
}!
"talk": apis  the good, the bad & the ugly,!
"name : nikhil bendre,!
"twitter : @npbendre,!
site: npbendre.com!
API
REST as a Guide
HTTP/1.1!
Server:!
200 OK!
nginx!
Date:"Wed, 14
Content-Type:!
Sep 2014 14:03:33!
application/json;!
GMT!
charset=utf-8!
Connection:
Status: 200!
keep-alive
OK!
ETag:! "ef742caec0c19e2169ffb05e7d200d17"!
Last-Modified: Sat, 13 Sep 2014 10:52:21 GMT!
!
{!
}!
GET https://api.example.com/user/8913	
 油
"talk": apis  the good, the bad & the ugly,!
"name : nikhil bendre,!
"twitter : @npbendre,!
site: npbendre.com!
HTTP/1.1!
Server:!
200 OK!
nginx!
Date:"Wed, 14
Content-Type:!
Sep 2014 14:03:33!
application/json;!
GMT!
charset=utf-8!
Connection:
Status: 200!
keep-alive
OK!
ETag:! "ef742caec0c19e2169ffb05e7d200d17"!
Last-Modified: Sat, 13 Sep 2014 10:52:21 GMT!
!
{!
}!
GET https://api.example.com/user/1234 	
 油
"talk": apis  the good, the bad & the ugly,!
"name : nikhil bendre,!
"twitter : @npbendre,!
site: npbendre.com!
HTTP/1.1!
Server:!
200 OK!
nginx!
Date:"Wed, 14
Content-Type:!
Sep 2014 14:03:33!
application/json;!
GMT!
charset=utf-8!
Connection:
Status: 200!
keep-alive
OK!
ETag:! "ef742caec0c19e2169ffb05e7d200d17"!
Last-Modified: Sat, 13 Sep 2014 10:52:21 GMT!
!
{!
}!
GET https://api.example.com/user/1234 	
 油
"talk": apis  the good, the bad & the ugly,!
"name : nikhil bendre,!
"twitter : @npbendre,!
site: npbendre.com!
HTTP/1.1!
Server:!
200 OK!
nginx!
Date:"Wed, 14
Content-Type:!
Sep 2014 14:03:33!
application/json;!
GMT!
charset=utf-8!
Connection:
Status: 200!
keep-alive
OK!
ETag:! "ef742caec0c19e2169ffb05e7d200d17"!
Last-Modified: Sat, 13 Sep 2014 10:52:21 GMT!
!
{!
}!
GET https://api.example.com/user/1234 	
 油
"talk": apis  the good, the bad & the ugly,!
"name : nikhil bendre,!
"twitter : @npbendre,!
site: npbendre.com!
HTTP/1.1!
Server:!
200 OK!
nginx!
Date:"Wed, 14
Content-Type:!
Sep 2014 14:03:33!
application/json;!
GMT!
charset=utf-8!
Connection:
Status: 200!
keep-alive
OK!
ETag:! "ef742caec0c19e2169ffb05e7d200d17"!
Last-Modified: Sat, 13 Sep 2014 10:52:21 GMT!
!
{!
}!
GET https://api.example.com/user/1234 	
 油
"talk": apis  the good, the bad & the ugly,!
"name : nikhil bendre,!
"twitter : @npbendre,!
site: npbendre.com!
HTTP/1.1!
Server:!
200 OK!
nginx!
Date:"Wed, 14
Content-Type:!
Sep 2014 14:03:33!
application/json;!
GMT!
charset=utf-8!
Connection:
Status: 200!
keep-alive
OK!
ETag:! "ef742caec0c19e2169ffb05e7d200d17"!
Last-Modified: Sat, 13 Sep 2014 10:52:21 GMT!
!
{!
}!
GET https://api.example.com/user/1234 	
 油
"talk": apis  the good, the bad & the ugly,!
"name : nikhil bendre,!
"twitter : @npbendre,!
site: npbendre.com!
api.example.com/me
http://maps.company.com/maps/api/
staticmap?center=Brooklyn+Bridge,New!
+York,NY&zoom=13&size=600x300&maptype=road
map&markers=color:blue%7Clabel:S!
%7C40.702147,-74.015794&markers=color:gree
n%7Clabel:G%7C40.711614,-74.012318!
&markers=color:red%7Ccolor:red%7Clabel:C!
%7C40.718217,-73.998284&sensor=false!
FIRST: DEFINE RESOURCES
A Good Approach: StructureYour URLs
what if
/createUser
/getDirectory
/verifyUser
/updateUser
/createEvent
what if
/createUser
/getDirectory
/verifyUser
/updateUser
/createEvent
/verifyEvent
/deleteUser
/updateUser
/updateUserName
.
collection
&
instance
/鍖les /鍖les/982
SECOND: USE RESOURCES
CRUD,but not really
Partially update a resource
GET
POST
PUT
DELETE
PATCH
Retrieve resource
Create resource
Update a resource
Delete a resource
HEAD Get only the headers
Media Type
Request: Accept header
Response: Content-Type header
Meaningful Response Code
APIs - the good, the bad & the ugly
2xx: Success
3xx: Redirection
4xx: Client Error
5xx: Server Error
Bad
{error: code 782 }
Good
HTTP 1.1 400
{
error : 鍖eld was missing,
link : apidocs.com/400,
}
	
 油
error response
Versioning
Accept
Content-Type
application/json+foo;application&v1
https://api.example.com/v1
vs
ETAGS ARE COOL. NOBODY USESEM
HTTP/1.1!
Server:!
200 OK!
nginx!
Date:"Wed, 14
Content-Type:!
Sep 2014 14:03:33!
application/json;!
GMT!
charset=utf-8!
Connection:
Status: 200!
keep-alive
OK!
ETag:! "ef742caec0c19e2169ffb05e7d200d17"!
Last-Modified: Sat, 13 Sep 2014 10:52:21 GMT!
{!
}!
data: !
Server Response
HTTP/1.1! 304 Not Modified!
Date:"Wed, 14! Sep 2014 14:03:33! GMT!
Last-Modified: Sat, 13 Sep 2014 10:53:21 GMT!
Client Request
curl -i -H "If-None-Match:
"ef742caec0c19e2169ffb05e7d200d17""
"https://graph.beta.facebook.com/me/
adaccounts?access_token=___"!
HYPERMEDIA
SUN CLOUD API
GET /machines/1/
Host: example.com
Accept: application/xml
Sample Request
HTTP/1.1 200 OK
Content-Type: application/xml
<status>stopped</status>
<link rel="start" method="post"
href="machines/2?op=start" />
Sample Response
Security
Photo by Tojosan - Creative Commons Attribution-NonCommercial-ShareAlike License https://www.flickr.com/photos/28069288@N00	
 油 Created with Haiku Deck	
 油
APIs - the good, the bad & the ugly
APIs - the good, the bad & the ugly
APIs - the good, the bad & the ugly
Models
Proprietary Solution
Basic Authentication
OAuth 1.0
OAuth 2.0
Make Docs Obvious
APIs - the good, the bad & the ugly
Supported Options
Examples
Required & Optional Attributes
Default Values
Error Codes
Automate
APIs - the good, the bad & the ugly
APIs - the good, the bad & the ugly
APIs - the good, the bad & the ugly
Build
something
meaningful
with your
APIs
APIs - the good, the bad & the ugly
APIs - the good, the bad & the ugly
RATE LIMIT
Photo by GirlieMac - Creative Commons Attribution License https://www.flickr.com/photos/70561195@N00	
 油 Created with Haiku Deck	
 油
CHATTY API
Lets
Play!
Download Play 2.3.4
Compile, Run & Test
activator new
select template & name
activator run
APIs - the good, the bad & the ugly
Controllers
GET / controllers.Application.index()
GET /users ...getUsers()
GET /users/:id ...getUserById(id: String)
Models
Ebeans for Java
JPA Annotations
Versioned Evolution Scripts
Test
Based on JUnit
Mockito
Integration & UI Test
Pros
Easy Url routing
Class Reloading
Java&Scala support
Java/Ebean support
NIO Server
TEST
& PERFORMANCE
RUNSCOPE
Thanks
Attributions
≒ Cat by Marco Petrucci from The Noun Project
≒ Chat by Alberto Guerra Quintanilla from The Noun Project
≒ Co鍖ee by Monika Ciapala from The Noun Project
≒ Key by Simple Icons from The Noun Project
≒ Lock by Jardson A. from The Noun Project
≒ Magnifying Glass by Naomi Atkinson from The Noun Project
≒ Gauge by Olivier Guin from The Noun Project
≒ Lock by Andrew Forrester from The Noun Project
≒ Fork by Dmitry Baranovskiy from The Noun Project
≒ Click icon is open source
≒ Document icon by Joe Richardson from The Noun Project
≒ Robot icon by Jon Trillana
≒ Tasks list by Arthur Shlain from The Noun Project
≒ Graph by David Waschb端sch from The Noun Project
≒ HTTP cats photo from girliemac
≒ Photo by Tojosan
Ad

Recommended

Chef at WebMD
Chef at WebMD
adamleff
Making it Work Offline: Current & Future Offline APIs for Web Apps
Making it Work Offline: Current & Future Offline APIs for Web Apps
Natasha Rooney
Chef at Etsy
Chef at Etsy
Jon Cowie
The Environment Restaurant
The Environment Restaurant
Martin de Keijzer
Packaging Software, Puppet Labs Style - PuppetConf 2014
Packaging Software, Puppet Labs Style - PuppetConf 2014
Puppet
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
Ken Collins
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
SmartLogic
Enabling Microservices @Orbitz - Velocity Conf 2015
Enabling Microservices @Orbitz - Velocity Conf 2015
Steve Hoffman
Superb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with Sensu
Paul O'Connor
Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.io
Rick Copeland
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update Service
Quinlan Jung
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
Alessandro Nadalin
ZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everything
Gianluca Arbezzano
Prometheus meets Consul -- Consul Casual Talks
Prometheus meets Consul -- Consul Casual Talks
Satoshi Suzuki
Vagrant - PugMI
Vagrant - PugMI
Gianluca Arbezzano
One Container, Two Container, Three Containers, Four
One Container, Two Container, Three Containers, Four
Ashley Roach
So you think you know REST - DPC11
So you think you know REST - DPC11
Evert Pot
distributing over the web
distributing over the web
Nicola Baldi
Design Web Service API by HungerStation
Design Web Service API by HungerStation
ArabNet ME
Android and REST
Android and REST
Roman Wo添niak
Designing RESTful APIs
Designing RESTful APIs
anandology
The never-ending REST API design debate
The never-ending REST API design debate
Restlet
Don't screw it up! How to build durable API
Don't screw it up! How to build durable API
Alessandro Cinelli (cirpo)
RESTful Services
RESTful Services
Jason Gerard
Standards of rest api
Standards of rest api
Ma箪ur Chourasiya
弌仂亰亟舒仆亳亠 API, 从仂仂仂亠 仗仂仍ミ英 舒亰舒弍仂亳从亳. 仍弍仂从仂亠 仗仂亞亢亠仆亳亠
弌仂亰亟舒仆亳亠 API, 从仂仂仂亠 仗仂仍ミ英 舒亰舒弍仂亳从亳. 仍弍仂从仂亠 仗仂亞亢亠仆亳亠
SQALab
Great webapis
Great webapis
Rafa Hryniewski
Api anti patterns
Api anti patterns
Mike Pearce
The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016
Restlet
RefCard RESTful API Design
RefCard RESTful API Design
OCTO Technology

More Related Content

What's hot (8)

Superb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with Sensu
Paul O'Connor
Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.io
Rick Copeland
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update Service
Quinlan Jung
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
Alessandro Nadalin
ZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everything
Gianluca Arbezzano
Prometheus meets Consul -- Consul Casual Talks
Prometheus meets Consul -- Consul Casual Talks
Satoshi Suzuki
Vagrant - PugMI
Vagrant - PugMI
Gianluca Arbezzano
One Container, Two Container, Three Containers, Four
One Container, Two Container, Three Containers, Four
Ashley Roach
Superb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with Sensu
Paul O'Connor
Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.io
Rick Copeland
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update Service
Quinlan Jung
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
Alessandro Nadalin
ZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everything
Gianluca Arbezzano
Prometheus meets Consul -- Consul Casual Talks
Prometheus meets Consul -- Consul Casual Talks
Satoshi Suzuki
One Container, Two Container, Three Containers, Four
One Container, Two Container, Three Containers, Four
Ashley Roach

Similar to APIs - the good, the bad & the ugly (20)

So you think you know REST - DPC11
So you think you know REST - DPC11
Evert Pot
distributing over the web
distributing over the web
Nicola Baldi
Design Web Service API by HungerStation
Design Web Service API by HungerStation
ArabNet ME
Android and REST
Android and REST
Roman Wo添niak
Designing RESTful APIs
Designing RESTful APIs
anandology
The never-ending REST API design debate
The never-ending REST API design debate
Restlet
Don't screw it up! How to build durable API
Don't screw it up! How to build durable API
Alessandro Cinelli (cirpo)
RESTful Services
RESTful Services
Jason Gerard
Standards of rest api
Standards of rest api
Ma箪ur Chourasiya
弌仂亰亟舒仆亳亠 API, 从仂仂仂亠 仗仂仍ミ英 舒亰舒弍仂亳从亳. 仍弍仂从仂亠 仗仂亞亢亠仆亳亠
弌仂亰亟舒仆亳亠 API, 从仂仂仂亠 仗仂仍ミ英 舒亰舒弍仂亳从亳. 仍弍仂从仂亠 仗仂亞亢亠仆亳亠
SQALab
Great webapis
Great webapis
Rafa Hryniewski
Api anti patterns
Api anti patterns
Mike Pearce
The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016
Restlet
RefCard RESTful API Design
RefCard RESTful API Design
OCTO Technology
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
Sumy PHP User Grpoup
Rest APIs Training
Rest APIs Training
Shekhar Kumar
rest-api-basics.pptx
rest-api-basics.pptx
AgungSutikno1
Web Services Tutorial
Web Services Tutorial
Lorna Mitchell
NEPHP '13: Pragmatic API Development
NEPHP '13: Pragmatic API Development
Andrew Curioso
REST APIS web development for backend familiarity
REST APIS web development for backend familiarity
ARTUROGOMEZGARCIA2
So you think you know REST - DPC11
So you think you know REST - DPC11
Evert Pot
distributing over the web
distributing over the web
Nicola Baldi
Design Web Service API by HungerStation
Design Web Service API by HungerStation
ArabNet ME
Designing RESTful APIs
Designing RESTful APIs
anandology
The never-ending REST API design debate
The never-ending REST API design debate
Restlet
Don't screw it up! How to build durable API
Don't screw it up! How to build durable API
Alessandro Cinelli (cirpo)
RESTful Services
RESTful Services
Jason Gerard
弌仂亰亟舒仆亳亠 API, 从仂仂仂亠 仗仂仍ミ英 舒亰舒弍仂亳从亳. 仍弍仂从仂亠 仗仂亞亢亠仆亳亠
弌仂亰亟舒仆亳亠 API, 从仂仂仂亠 仗仂仍ミ英 舒亰舒弍仂亳从亳. 仍弍仂从仂亠 仗仂亞亢亠仆亳亠
SQALab
Api anti patterns
Api anti patterns
Mike Pearce
The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016
Restlet
RefCard RESTful API Design
RefCard RESTful API Design
OCTO Technology
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
Sumy PHP User Grpoup
Rest APIs Training
Rest APIs Training
Shekhar Kumar
rest-api-basics.pptx
rest-api-basics.pptx
AgungSutikno1
Web Services Tutorial
Web Services Tutorial
Lorna Mitchell
NEPHP '13: Pragmatic API Development
NEPHP '13: Pragmatic API Development
Andrew Curioso
REST APIS web development for backend familiarity
REST APIS web development for backend familiarity
ARTUROGOMEZGARCIA2
Ad

Recently uploaded (20)

Folding Cheat Sheet # 9 - List Unfolding as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding as the Computational Dual of ...
Philip Schwarz
Key Challenges in Troubleshooting Customer On-Premise Applications
Key Challenges in Troubleshooting Customer On-Premise Applications
Tier1 app
Zonerankers Digital marketing solutions
Zonerankers Digital marketing solutions
reenashriee
Download Adobe Illustrator Crack free for Windows 2025?
Download Adobe Illustrator Crack free for Windows 2025?
grete1122g
Artificial Intelligence Workloads and Data Center Management
Artificial Intelligence Workloads and Data Center Management
SandeepKS52
Emvigo Capability Deck 2025: Accelerating Innovation Through Intelligent Soft...
Emvigo Capability Deck 2025: Accelerating Innovation Through Intelligent Soft...
Emvigo Technologies
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
openSAP_s4h27_Week_1_2025_All_際際滷s.pdf
openSAP_s4h27_Week_1_2025_All_際際滷s.pdf
Thomas Qiao
OpenChain Webinar - AboutCode - Practical Compliance in One Stack Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack Licensing...
Shane Coughlan
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
WSO2
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
2nd Sight Lab
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Safe Software
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
A Guide to Telemedicine Software Development.pdf
A Guide to Telemedicine Software Development.pdf
Olivero Bozzelli
Simplify Task, Team, and Project Management with Orangescrum Work
Simplify Task, Team, and Project Management with Orangescrum Work
Orangescrum
Folding Cheat Sheet # 9 - List Unfolding as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding as the Computational Dual of ...
Philip Schwarz
Key Challenges in Troubleshooting Customer On-Premise Applications
Key Challenges in Troubleshooting Customer On-Premise Applications
Tier1 app
Zonerankers Digital marketing solutions
Zonerankers Digital marketing solutions
reenashriee
Download Adobe Illustrator Crack free for Windows 2025?
Download Adobe Illustrator Crack free for Windows 2025?
grete1122g
Artificial Intelligence Workloads and Data Center Management
Artificial Intelligence Workloads and Data Center Management
SandeepKS52
Emvigo Capability Deck 2025: Accelerating Innovation Through Intelligent Soft...
Emvigo Capability Deck 2025: Accelerating Innovation Through Intelligent Soft...
Emvigo Technologies
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
openSAP_s4h27_Week_1_2025_All_際際滷s.pdf
openSAP_s4h27_Week_1_2025_All_際際滷s.pdf
Thomas Qiao
OpenChain Webinar - AboutCode - Practical Compliance in One Stack Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack Licensing...
Shane Coughlan
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
WSO2
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
2nd Sight Lab
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Safe Software
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
A Guide to Telemedicine Software Development.pdf
A Guide to Telemedicine Software Development.pdf
Olivero Bozzelli
Simplify Task, Team, and Project Management with Orangescrum Work
Simplify Task, Team, and Project Management with Orangescrum Work
Orangescrum
Ad

APIs - the good, the bad & the ugly