SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
©2015 Apigee Corp. All Rights Reserved.
©2015 Apigee Corp. All Rights Reserved. 
Intro
• Why care about
this topic?
• Why care about
what we think?
©2015 Apigee Corp. All Rights Reserved. 
Topics
• What is a "REST API"
– Data-oriented versus Service-oriented APIs
– Hypermedia
– JSON representations
– Collections
• Versioning
©2015 Apigee Corp. All Rights Reserved. 
History
Service-oriented
 Data-oriented
RPC
CORBA
SOAP/WSDL
"REST API"
NLS
Xanadu
Databases
World-Wide Web
REST
??
Object-orientation
"REST API"
©2015 Apigee Corp. All Rights Reserved. 
Opposing Perspectives
Service-oriented



Data behind operations
Data-oriented



Operations behind data
©2015 Apigee Corp. All Rights Reserved. 
Opposing Perspectives
Service-oriented
	
  
	
  
	
  
	
  
getPerson(personId)	
  
updatePerson(personId,	
  data)	
  
deletePerson(personId)	
  
Data-oriented

	
  
	
  
	
  
http://primary-­‐key-­‐value	
  
http://example.org/person/12345	
  
©2015 Apigee Corp. All Rights Reserved. 
Why We Like Data-Oriented APIs
• The primary value is the data it exposes
• Data-Oriented is Simpler
– Learn the data vs learn the services + the data
– Don’t design an API at all, just use REST
©2015 Apigee Corp. All Rights Reserved. 
What Is Important?
Are you wasting
time repetitively
documenting the
standard HTTP
REST patterns?
©2015 Apigee Corp. All Rights Reserved. 
What would be better?
9
©2015 Apigee. All Rights Reserved. 
PetTracker
Dog
People
dogs n
people n
1
 1
owner 1
 dogs n
birthDate
 birthDate
hairColor
 furColor
name
 name
REST/HTTP
+
©2015 Apigee Corp. All Rights Reserved. 
Follow the REST/HTTP patterns exactly
• E.g.
– POST means Create. Response status code is 201. URL of
new resource is in the 'Location' header
– PUT means 'replace', not 'update'. PATCH means 'update'
– GET response includes ETag and Content-Location headers
– PUT and PATCH require an 'If-Match' header
– …
10
©2015 Apigee. All Rights Reserved.
©2015 Apigee Corp. All Rights Reserved. 
Gaps in HTTP/REST for programmatic use
•  How do you represent relationships
– Single-valued
•  What is a hyperlink?
– Multi-valued
•  What is a Collection/Cursor?
•  HTML provides some answers for the human-readable web
–  <a ref = "http://example.org/people/98765432">Joe Carraclough</a>
•  What is the equivalent for JSON?
11
©2015 Apigee. All Rights Reserved.
©2015 Apigee Corp. All Rights Reserved. 
Hypermedia — Just Do It
•  Most data is conceptually linked
–  So show the links in the data
•  Myths
–  Hypermedia APIs are controversial (practiced by extremists)
–  Hypermedia APIs are difficult
–  Hypermedia APIs are 100% self-describing
–  Hypermedia APIs are not compatible with languages like
Swagger (or other DLs)
©2015 Apigee Corp. All Rights Reserved. 
Service-Oriented Data-Oriented
http://example.org/people	
  
http://example.org/people/{personID}	
  
http://example.org/people/{personID}/dogs	
  
http://example.org/dogs	
  
http://example.org/dogs/{dogID}	
  
http://example.org/dogs/{dogID}/owner	
  
	
   	
   	
  plus	
  
{"id":	
  "12345678",	
  	
  
	
  "type":	
  "Dog"	
  
	
  "name":	
  "Lassie",	
  	
  
	
  "fur_color":	
  "brown",	
  
	
  "owner":	
  "98765432"}	
  
and	
  
{"id":"98765432",	
  	
  
	
  "type":	
  "Person"	
  
	
  "name":	
  "Joe	
  Carraclough",	
  	
  
	
  "hair_color":	
  "brown"}	
  
	
  
{"self":	
  "http://example.org/",	
  
	
  "type":	
  "PetTracker",	
  
	
  "dogs":	
  "http://example.org/dogs",	
  
	
  "people":	
  "http://example.org/people}	
  
	
  	
   	
  and	
  
{"self":	
  "http://example.org/dogs/12345678",	
  	
  
	
  "type":	
  "Dog",	
  
	
  "name":	
  "Lassie",	
  	
  
	
  "fur_color":	
  "brown",	
  
	
  "owner":	
  "http://example.org/people/98765432"}	
  
and	
  
{"self":	
  "http://example.org/people/98765432",	
  	
  
	
  "type":	
  "Person",	
  
	
  "name":	
  "Joe	
  Carraclough",	
  	
  
	
  "hair_color":	
  "brown",	
  
	
  "dogs":	
  "http://example.org/people/98765432/dogs"}	
  
	
  
©2015 Apigee Corp. All Rights Reserved. 
Cursor/Collection
{	
  
	
  "self":	
  "http://example.org/dogs",	
  
	
  "type":	
  "Collection",	
  
	
  "items":	
  [	
  
{"self":	
  "http://example.org/dogs/12345678",	
  	
  
	
  "type":	
  "Dog",	
  
	
  "name":	
  "Lassie",	
  	
  
	
  "fur_color":	
  "brown",	
  
	
  "owner":	
  "http://example.org/people/98765432"},	
  
{"self":	
  "http://example.org/dogs/12345679",	
  	
  
	
  "type":	
  "Dog",	
  
	
  "name":	
  "Lassie",	
  	
  
	
  "fur_color":	
  "brown",	
  
	
  "owner":	
  "http://example.org/people/98765432"}	
  
]	
  
}	
  
14
©2015 Apigee. All Rights Reserved.
©2015 Apigee Corp. All Rights Reserved. 
Cursor/Collection
{	
  
	
  "self":	
  "http://example.org/dogs?limit=10",	
  
	
  "type":	
  "Page",	
  
	
  "collection":	
  "http://example.org/dogs",	
  
	
  "next":	
  "http://example.org/ZG9ncz87bGFzdD0xMA==",	
  
	
  "previous":	
  "http://example.org/ZG9ncz87Zmlyc3Q9MTA=",	
  
	
  "items":	
  [	
  
{"self":	
  "http://example.org/dogs/12345678",	
  	
  
	
  "type":	
  "Dog",	
  
	
  "name":	
  "Lassie",	
  	
  
	
  "fur_color":	
  "brown",	
  
	
  "owner":	
  "http://example.org/people/98765432"},	
  
{"self":	
  "http://example.org/dogs/12345679",	
  	
  
	
  "type":	
  "Dog",	
  
	
  "name":	
  "Lassie",	
  	
  
	
  "fur_color":	
  "brown",	
  
	
  "owner":	
  "http://example.org/people/98765432"}	
  
]	
  
}	
  
15
©2015 Apigee. All Rights Reserved.
©2015 Apigee Corp. All Rights Reserved. 
A File in Google Drive
{	
  
"kind":	
  "drive#file",	
  
"id":	
  "1cjKSwWlryNfRs-­‐durx_8n0dGTUWE_klBrP8IuEYTUu0",	
  
"etag":	
  "9vYBbk7LzzrwpsohQSOkWalvY6Y/MTQ0Mjc1ODk5NzAwMQ",	
  
"selfLink":	
  "https://www.googleapis.com/drive/v2/files/1cjKSwWlryNfRs-­‐durx_8n0dGTUWE_klBrP8IuEYTUu0",	
  
"alternateLink":	
  "https://docs.google.com/a/apigee.com/document/d/1cjKSwWlryNfRs-­‐durx_8n0dGTUWE_klBrP8IuEYTUu0/edit?usp=drivesdk",	
  
"embedLink":	
  "https://docs.google.com/a/apigee.com/document/d/1cjKSwWlryNfRs-­‐durx_8n0dGTUWE_klBrP8IuEYTUu0/preview",	
  
...	
  
"title":	
  "Web	
  API	
  Design	
  edition	
  2",	
  
"mimeType":	
  "application/vnd.google-­‐apps.document",	
  
...	
  
"createdDate":	
  "2015-­‐07-­‐10T15:26:34.567Z",	
  
"modifiedDate":	
  "2015-­‐09-­‐20T14:23:17.001Z",	
  
"modifiedByMeDate":	
  "2015-­‐09-­‐20T14:23:17.001Z",	
  
"lastViewedByMeDate":	
  "2015-­‐09-­‐30T23:16:08.011Z",	
  
"markedViewedByMeDate":	
  "1970-­‐01-­‐01T00:00:00.000Z",	
  
"version":	
  "41819",	
  
...	
  
	
  
©2015 Apigee Corp. All Rights Reserved. 
A Folder's Children in Google Drive
{	
  
"kind":	
  "drive#childList",	
  
"etag":	
  "9vYBbk7LzzrwpsohQSOkWalvY6Y/73yTWsreOINR667_OZQCurHB09o",	
  
"selfLink":	
  "https://www.googleapis.com/drive/v2/files/0B2Pq-­‐qMI4R2jYVdudkdNMld3Vm8/children",	
  
"items":	
  [	
  
	
  {	
  
	
  	
  "kind":	
  "drive#childReference",	
  
	
  	
  "id":	
  "1BuYLy9FkXpILYmwnRNetnUFCC9D-­‐U35PrJcO_9YsuW0",	
  
	
  	
  "selfLink":	
  "
https://www.googleapis.com/drive/v2/files/0B2Pq-­‐qMI4R2jYVdudkdNMld3Vm8/children/1BuYLy9FkXpILYmwnRNetnUFCC9D-­‐U35PrJcO_9YsuW0",	
  
	
  	
  "childLink":	
  "https://www.googleapis.com/drive/v2/files/1BuYLy9FkXpILYmwnRNetnUFCC9D-­‐U35PrJcO_9YsuW0"	
  
	
  },	
  
	
  {	
  
	
  	
  "kind":	
  "drive#childReference",	
  
	
  	
  "id":	
  "1pfcXbfX9PaUk12Cywqav9H77-­‐DQEWhxjeKHgu1qpAi8",	
  
	
  	
  "selfLink":	
  "
https://www.googleapis.com/drive/v2/files/0B2Pq-­‐qMI4R2jYVdudkdNMld3Vm8/children/1pfcXbfX9PaUk12Cywqav9H77-­‐DQEWhxjeKHgu1qpAi8",	
  
	
  	
  "childLink":	
  "https://www.googleapis.com/drive/v2/files/1pfcXbfX9PaUk12Cywqav9H77-­‐DQEWhxjeKHgu1qpAi8"	
  
	
  }	
  
]	
  
}	
  
©2015 Apigee Corp. All Rights Reserved. 
Principles Illustrated
•  Use JSON
•  Keep your JSON simple and flat
•  Links can be simple properties
•  Collections are resources too
•  Provide a "self" property
•  Provide a "kind" property
©2015 Apigee Corp. All Rights Reserved. 
Perma-links Versus ‘Query URLs’
'Query URLs':
http://example.org/?type=Person&id=personID	
  
http://example.org/people/{personId}	
  
http://example.org/people/{personName}
vs Perma-links
http://example.org/cGVyc29uczt7cGVyc29uX2lkfS9kb2dz	
  	
  
©2015 Apigee Corp. All Rights Reserved. 
API Versioning
©2015 Apigee Corp. All Rights Reserved. 
The Most Complex Form of Versioning
•  Multiple versions of the same resource are available simultaneously
•  Client selects the version it needs
•  Cons:
–  It is expensive to implement
–  It doesn’t always work anyway
•  Pros:
–  Supports frequent versioning
•  Very few people actually do this
©2015 Apigee Corp. All Rights Reserved. 
Why Doesn’t It Always Work?
•  It doesn't work if you make substantial data-model changes
– You won’t be able to update through the old versions
•  It doesn't work for micro-services
– Consider:
•  /v1/orders/123456	
  
•  /v2/accounts/9876765	
  
– Now consider:
•  /v2/recent_changes	
  
– Should it include v1 format of orders, "
or v2 format of orders?
©2015 Apigee Corp. All Rights Reserved. 
Pragmatic Versioning
•  Only one version of each resource available at any one time
–  Make sure clients can tolerate minor changes
•  Version upgrade is infrequent
– Major breaking change
•  Less elegant version:
– https://api.acmecorp.com/orders/v1/123456	
  
– https://api.acmecorp.com/orders/v2/123456	
  
•  Elegant version – the ‘no-versioning’ strategy for versioning
– https://api.acmecorp.com/orders/123456	
  
– https://api2.acmecorp.com/orders/123456	
  
©2015 Apigee Corp. All Rights Reserved. 
Summary
•  Data-oriented APIs
•  Simple, flat JSON
•  Hypermedia
–  Hypermedia links can be simple JSON properties
•  Simple collections that are also resources
•  Simple, ‘no versioning’ versioning strategy
Thank you
Martin Nally
@mpnally
Marsh Gardiner
@earth2marsh

Más contenido relacionado

La actualidad más candente

OpenACT - Meet1 - Intro to APIs
OpenACT - Meet1 - Intro to APIsOpenACT - Meet1 - Intro to APIs
OpenACT - Meet1 - Intro to APIsOpenACT
 
How mentoring can help you start contributing to open source
How mentoring can help you start contributing to open sourceHow mentoring can help you start contributing to open source
How mentoring can help you start contributing to open sourceLuciano Resende
 
Owning the Lifecycle of a Drupal Digital Project
Owning the Lifecycle of a Drupal Digital ProjectOwning the Lifecycle of a Drupal Digital Project
Owning the Lifecycle of a Drupal Digital ProjectAcquia
 
Six Steps To Build A Successful API
Six Steps To Build A Successful APISix Steps To Build A Successful API
Six Steps To Build A Successful APIChris Haddad
 
Apache Usergrid for JavaScript Developers
Apache Usergrid for JavaScript DevelopersApache Usergrid for JavaScript Developers
Apache Usergrid for JavaScript DevelopersDavid M. Johnson
 
APIs and Linked Data: A match made in Heaven
APIs and Linked Data: A match made in HeavenAPIs and Linked Data: A match made in Heaven
APIs and Linked Data: A match made in HeavenMichael Petychakis
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache UsergridDavid M. Johnson
 
Coding from Application Container Cloud to Oracle JET
Coding from Application Container Cloud to Oracle JETCoding from Application Container Cloud to Oracle JET
Coding from Application Container Cloud to Oracle JETGeertjan Wielenga
 
geecon 2016: "What's Oracle Doing with JavaScript?!"
geecon 2016: "What's Oracle Doing with JavaScript?!"geecon 2016: "What's Oracle Doing with JavaScript?!"
geecon 2016: "What's Oracle Doing with JavaScript?!"Geertjan Wielenga
 
The 7 Deadly Sins of API Design
The 7 Deadly Sins of API DesignThe 7 Deadly Sins of API Design
The 7 Deadly Sins of API Designluisw19
 
Wrapping and Securing REST APIs with GraphQL
Wrapping and Securing REST APIs with GraphQLWrapping and Securing REST APIs with GraphQL
Wrapping and Securing REST APIs with GraphQLRoy Derks
 
Open Source Mobile Backend on Cassandra
Open Source Mobile Backend on CassandraOpen Source Mobile Backend on Cassandra
Open Source Mobile Backend on CassandraEd Anuff
 
Design for scale
Design for scaleDesign for scale
Design for scaleDoug Lampe
 
Making Smart Homes Smarter With Javascript
Making Smart Homes Smarter With JavascriptMaking Smart Homes Smarter With Javascript
Making Smart Homes Smarter With JavascriptJoel Lord
 
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaApache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaJahia Solutions Group
 
Get Some REST: Building Great APIs for Great Apps | Allen Pike, Steamclock So...
Get Some REST: Building Great APIs for Great Apps | Allen Pike, Steamclock So...Get Some REST: Building Great APIs for Great Apps | Allen Pike, Steamclock So...
Get Some REST: Building Great APIs for Great Apps | Allen Pike, Steamclock So...Dealmaker Media
 
Usergrid Overview
Usergrid OverviewUsergrid Overview
Usergrid Overviewusergrid
 
Apache Rave at The Apache Meetup in NL
Apache Rave at The Apache Meetup in NLApache Rave at The Apache Meetup in NL
Apache Rave at The Apache Meetup in NLJasha Joachimsthal
 

La actualidad más candente (20)

OpenACT - Meet1 - Intro to APIs
OpenACT - Meet1 - Intro to APIsOpenACT - Meet1 - Intro to APIs
OpenACT - Meet1 - Intro to APIs
 
How mentoring can help you start contributing to open source
How mentoring can help you start contributing to open sourceHow mentoring can help you start contributing to open source
How mentoring can help you start contributing to open source
 
Owning the Lifecycle of a Drupal Digital Project
Owning the Lifecycle of a Drupal Digital ProjectOwning the Lifecycle of a Drupal Digital Project
Owning the Lifecycle of a Drupal Digital Project
 
Six Steps To Build A Successful API
Six Steps To Build A Successful APISix Steps To Build A Successful API
Six Steps To Build A Successful API
 
Apache Usergrid for JavaScript Developers
Apache Usergrid for JavaScript DevelopersApache Usergrid for JavaScript Developers
Apache Usergrid for JavaScript Developers
 
APIs and Linked Data: A match made in Heaven
APIs and Linked Data: A match made in HeavenAPIs and Linked Data: A match made in Heaven
APIs and Linked Data: A match made in Heaven
 
Session at Oredev 2016.
Session at Oredev 2016.Session at Oredev 2016.
Session at Oredev 2016.
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
Coding from Application Container Cloud to Oracle JET
Coding from Application Container Cloud to Oracle JETCoding from Application Container Cloud to Oracle JET
Coding from Application Container Cloud to Oracle JET
 
geecon 2016: "What's Oracle Doing with JavaScript?!"
geecon 2016: "What's Oracle Doing with JavaScript?!"geecon 2016: "What's Oracle Doing with JavaScript?!"
geecon 2016: "What's Oracle Doing with JavaScript?!"
 
The 7 Deadly Sins of API Design
The 7 Deadly Sins of API DesignThe 7 Deadly Sins of API Design
The 7 Deadly Sins of API Design
 
Wrapping and Securing REST APIs with GraphQL
Wrapping and Securing REST APIs with GraphQLWrapping and Securing REST APIs with GraphQL
Wrapping and Securing REST APIs with GraphQL
 
Open Source Mobile Backend on Cassandra
Open Source Mobile Backend on CassandraOpen Source Mobile Backend on Cassandra
Open Source Mobile Backend on Cassandra
 
Design for scale
Design for scaleDesign for scale
Design for scale
 
Making Smart Homes Smarter With Javascript
Making Smart Homes Smarter With JavascriptMaking Smart Homes Smarter With Javascript
Making Smart Homes Smarter With Javascript
 
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaApache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
 
Get Some REST: Building Great APIs for Great Apps | Allen Pike, Steamclock So...
Get Some REST: Building Great APIs for Great Apps | Allen Pike, Steamclock So...Get Some REST: Building Great APIs for Great Apps | Allen Pike, Steamclock So...
Get Some REST: Building Great APIs for Great Apps | Allen Pike, Steamclock So...
 
Usergrid Overview
Usergrid OverviewUsergrid Overview
Usergrid Overview
 
Apache Rave at The Apache Meetup in NL
Apache Rave at The Apache Meetup in NLApache Rave at The Apache Meetup in NL
Apache Rave at The Apache Meetup in NL
 
Oracle User Group Holland
Oracle User Group HollandOracle User Group Holland
Oracle User Group Holland
 

Similar a Webcast: Pragmatic REST: The Next Generation

Pragmatic REST: recent trends in API design
Pragmatic REST: recent trends in API designPragmatic REST: recent trends in API design
Pragmatic REST: recent trends in API designMarsh Gardiner
 
Rest in practice
Rest in practiceRest in practice
Rest in practiceIan Brennan
 
SpagoBI 5 Demo Day and Workshop : Technology Applications and Uses
SpagoBI 5 Demo Day and Workshop : Technology Applications and UsesSpagoBI 5 Demo Day and Workshop : Technology Applications and Uses
SpagoBI 5 Demo Day and Workshop : Technology Applications and UsesSpagoWorld
 
Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Akana
 
OSMC 2014: Using elasticsearch, logstash & kibana in system administration | ...
OSMC 2014: Using elasticsearch, logstash & kibana in system administration | ...OSMC 2014: Using elasticsearch, logstash & kibana in system administration | ...
OSMC 2014: Using elasticsearch, logstash & kibana in system administration | ...NETWAYS
 
Hypermedia api (HATEOAS)
Hypermedia api (HATEOAS)Hypermedia api (HATEOAS)
Hypermedia api (HATEOAS)MitinPavel
 
A Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIsA Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIsSmartLogic
 
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsJorge Ferrer
 
DataEngConf SF16 - Methods for Content Relevance at LinkedIn
DataEngConf SF16 - Methods for Content Relevance at LinkedInDataEngConf SF16 - Methods for Content Relevance at LinkedIn
DataEngConf SF16 - Methods for Content Relevance at LinkedInHakka Labs
 
Big Data at Oracle - Strata 2015 San Jose
Big Data at Oracle - Strata 2015 San JoseBig Data at Oracle - Strata 2015 San Jose
Big Data at Oracle - Strata 2015 San JoseJeffrey T. Pollock
 
Which Freaking Database Should I Use?
Which Freaking Database Should I Use?Which Freaking Database Should I Use?
Which Freaking Database Should I Use?Great Wide Open
 
James Higginbotham - API Design
James Higginbotham - API DesignJames Higginbotham - API Design
James Higginbotham - API DesignJohn Zozzaro
 
Architect's Guide to Building an API Program
Architect's Guide to Building an API ProgramArchitect's Guide to Building an API Program
Architect's Guide to Building an API Programclatimer
 
Great APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGreat APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGabriel Lucaciu
 
NASA SensorWeb Enterprise Services
NASA SensorWeb Enterprise ServicesNASA SensorWeb Enterprise Services
NASA SensorWeb Enterprise ServicesPat Cappelaere
 
A Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbA Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbSmartLogic
 
Put iOS and Android on the same Wavelength with Serverless Microservices
Put iOS and Android on the same Wavelength with Serverless MicroservicesPut iOS and Android on the same Wavelength with Serverless Microservices
Put iOS and Android on the same Wavelength with Serverless MicroservicesNeil Power
 
The Key to Big Data Modeling: Collaboration
The Key to Big Data Modeling: CollaborationThe Key to Big Data Modeling: Collaboration
The Key to Big Data Modeling: CollaborationEmbarcadero Technologies
 
API Design Tour with Digital River and Apigee - June 26th, 2012
API Design Tour with Digital River and Apigee - June 26th, 2012API Design Tour with Digital River and Apigee - June 26th, 2012
API Design Tour with Digital River and Apigee - June 26th, 2012rubes_mn
 

Similar a Webcast: Pragmatic REST: The Next Generation (20)

Pragmatic REST: recent trends in API design
Pragmatic REST: recent trends in API designPragmatic REST: recent trends in API design
Pragmatic REST: recent trends in API design
 
Rest in practice
Rest in practiceRest in practice
Rest in practice
 
SpagoBI 5 Demo Day and Workshop : Technology Applications and Uses
SpagoBI 5 Demo Day and Workshop : Technology Applications and UsesSpagoBI 5 Demo Day and Workshop : Technology Applications and Uses
SpagoBI 5 Demo Day and Workshop : Technology Applications and Uses
 
Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?
 
OSMC 2014: Using elasticsearch, logstash & kibana in system administration | ...
OSMC 2014: Using elasticsearch, logstash & kibana in system administration | ...OSMC 2014: Using elasticsearch, logstash & kibana in system administration | ...
OSMC 2014: Using elasticsearch, logstash & kibana in system administration | ...
 
Hypermedia api (HATEOAS)
Hypermedia api (HATEOAS)Hypermedia api (HATEOAS)
Hypermedia api (HATEOAS)
 
A Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIsA Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIs
 
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
 
DataEngConf SF16 - Methods for Content Relevance at LinkedIn
DataEngConf SF16 - Methods for Content Relevance at LinkedInDataEngConf SF16 - Methods for Content Relevance at LinkedIn
DataEngConf SF16 - Methods for Content Relevance at LinkedIn
 
Big Data at Oracle - Strata 2015 San Jose
Big Data at Oracle - Strata 2015 San JoseBig Data at Oracle - Strata 2015 San Jose
Big Data at Oracle - Strata 2015 San Jose
 
Which Freaking Database Should I Use?
Which Freaking Database Should I Use?Which Freaking Database Should I Use?
Which Freaking Database Should I Use?
 
James Higginbotham - API Design
James Higginbotham - API DesignJames Higginbotham - API Design
James Higginbotham - API Design
 
Architect's Guide to Building an API Program
Architect's Guide to Building an API ProgramArchitect's Guide to Building an API Program
Architect's Guide to Building an API Program
 
Great APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGreat APIs - Future of Your Progress App
Great APIs - Future of Your Progress App
 
NASA SensorWeb Enterprise Services
NASA SensorWeb Enterprise ServicesNASA SensorWeb Enterprise Services
NASA SensorWeb Enterprise Services
 
A Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbA Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rb
 
Put iOS and Android on the same Wavelength with Serverless Microservices
Put iOS and Android on the same Wavelength with Serverless MicroservicesPut iOS and Android on the same Wavelength with Serverless Microservices
Put iOS and Android on the same Wavelength with Serverless Microservices
 
The Key to Big Data Modeling: Collaboration
The Key to Big Data Modeling: CollaborationThe Key to Big Data Modeling: Collaboration
The Key to Big Data Modeling: Collaboration
 
API Design Tour: Digital River
API Design Tour: Digital RiverAPI Design Tour: Digital River
API Design Tour: Digital River
 
API Design Tour with Digital River and Apigee - June 26th, 2012
API Design Tour with Digital River and Apigee - June 26th, 2012API Design Tour with Digital River and Apigee - June 26th, 2012
API Design Tour with Digital River and Apigee - June 26th, 2012
 

Más de Apigee | Google Cloud

Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Apigee | Google Cloud
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldApigee | Google Cloud
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Apigee | Google Cloud
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketApigee | Google Cloud
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsApigee | Google Cloud
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessApigee | Google Cloud
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorApigee | Google Cloud
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailApigee | Google Cloud
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranApigee | Google Cloud
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!Apigee | Google Cloud
 

Más de Apigee | Google Cloud (20)

How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)
 
Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Ticketmaster at a glance
Ticketmaster at a glanceTicketmaster at a glance
Ticketmaster at a glance
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First World
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?
 
Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management Market
 
Walgreens at a glance
Walgreens at a glanceWalgreens at a glance
Walgreens at a glance
 
Apigee Edge: Intro to Microgateway
Apigee Edge: Intro to MicrogatewayApigee Edge: Intro to Microgateway
Apigee Edge: Intro to Microgateway
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices Deployments
 
Pitney Bowes at a glance
Pitney Bowes at a glancePitney Bowes at a glance
Pitney Bowes at a glance
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices Success
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet Kapoor
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg Brail
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant Jhingran
 
London Adapt or Die: Opening Keynot
London Adapt or Die: Opening KeynotLondon Adapt or Die: Opening Keynot
London Adapt or Die: Opening Keynot
 
London Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynoteLondon Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynote
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!
 

Último

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Último (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Webcast: Pragmatic REST: The Next Generation

  • 1. ©2015 Apigee Corp. All Rights Reserved.
  • 2. ©2015 Apigee Corp. All Rights Reserved. Intro • Why care about this topic? • Why care about what we think?
  • 3. ©2015 Apigee Corp. All Rights Reserved. Topics • What is a "REST API" – Data-oriented versus Service-oriented APIs – Hypermedia – JSON representations – Collections • Versioning
  • 4. ©2015 Apigee Corp. All Rights Reserved. History Service-oriented Data-oriented RPC CORBA SOAP/WSDL "REST API" NLS Xanadu Databases World-Wide Web REST ?? Object-orientation "REST API"
  • 5. ©2015 Apigee Corp. All Rights Reserved. Opposing Perspectives Service-oriented Data behind operations Data-oriented Operations behind data
  • 6. ©2015 Apigee Corp. All Rights Reserved. Opposing Perspectives Service-oriented         getPerson(personId)   updatePerson(personId,  data)   deletePerson(personId)   Data-oriented       http://primary-­‐key-­‐value   http://example.org/person/12345  
  • 7. ©2015 Apigee Corp. All Rights Reserved. Why We Like Data-Oriented APIs • The primary value is the data it exposes • Data-Oriented is Simpler – Learn the data vs learn the services + the data – Don’t design an API at all, just use REST
  • 8. ©2015 Apigee Corp. All Rights Reserved. What Is Important? Are you wasting time repetitively documenting the standard HTTP REST patterns?
  • 9. ©2015 Apigee Corp. All Rights Reserved. What would be better? 9 ©2015 Apigee. All Rights Reserved. PetTracker Dog People dogs n people n 1 1 owner 1 dogs n birthDate birthDate hairColor furColor name name REST/HTTP +
  • 10. ©2015 Apigee Corp. All Rights Reserved. Follow the REST/HTTP patterns exactly • E.g. – POST means Create. Response status code is 201. URL of new resource is in the 'Location' header – PUT means 'replace', not 'update'. PATCH means 'update' – GET response includes ETag and Content-Location headers – PUT and PATCH require an 'If-Match' header – … 10 ©2015 Apigee. All Rights Reserved.
  • 11. ©2015 Apigee Corp. All Rights Reserved. Gaps in HTTP/REST for programmatic use •  How do you represent relationships – Single-valued •  What is a hyperlink? – Multi-valued •  What is a Collection/Cursor? •  HTML provides some answers for the human-readable web –  <a ref = "http://example.org/people/98765432">Joe Carraclough</a> •  What is the equivalent for JSON? 11 ©2015 Apigee. All Rights Reserved.
  • 12. ©2015 Apigee Corp. All Rights Reserved. Hypermedia — Just Do It •  Most data is conceptually linked –  So show the links in the data •  Myths –  Hypermedia APIs are controversial (practiced by extremists) –  Hypermedia APIs are difficult –  Hypermedia APIs are 100% self-describing –  Hypermedia APIs are not compatible with languages like Swagger (or other DLs)
  • 13. ©2015 Apigee Corp. All Rights Reserved. Service-Oriented Data-Oriented http://example.org/people   http://example.org/people/{personID}   http://example.org/people/{personID}/dogs   http://example.org/dogs   http://example.org/dogs/{dogID}   http://example.org/dogs/{dogID}/owner        plus   {"id":  "12345678",      "type":  "Dog"    "name":  "Lassie",      "fur_color":  "brown",    "owner":  "98765432"}   and   {"id":"98765432",      "type":  "Person"    "name":  "Joe  Carraclough",      "hair_color":  "brown"}     {"self":  "http://example.org/",    "type":  "PetTracker",    "dogs":  "http://example.org/dogs",    "people":  "http://example.org/people}        and   {"self":  "http://example.org/dogs/12345678",      "type":  "Dog",    "name":  "Lassie",      "fur_color":  "brown",    "owner":  "http://example.org/people/98765432"}   and   {"self":  "http://example.org/people/98765432",      "type":  "Person",    "name":  "Joe  Carraclough",      "hair_color":  "brown",    "dogs":  "http://example.org/people/98765432/dogs"}    
  • 14. ©2015 Apigee Corp. All Rights Reserved. Cursor/Collection {    "self":  "http://example.org/dogs",    "type":  "Collection",    "items":  [   {"self":  "http://example.org/dogs/12345678",      "type":  "Dog",    "name":  "Lassie",      "fur_color":  "brown",    "owner":  "http://example.org/people/98765432"},   {"self":  "http://example.org/dogs/12345679",      "type":  "Dog",    "name":  "Lassie",      "fur_color":  "brown",    "owner":  "http://example.org/people/98765432"}   ]   }   14 ©2015 Apigee. All Rights Reserved.
  • 15. ©2015 Apigee Corp. All Rights Reserved. Cursor/Collection {    "self":  "http://example.org/dogs?limit=10",    "type":  "Page",    "collection":  "http://example.org/dogs",    "next":  "http://example.org/ZG9ncz87bGFzdD0xMA==",    "previous":  "http://example.org/ZG9ncz87Zmlyc3Q9MTA=",    "items":  [   {"self":  "http://example.org/dogs/12345678",      "type":  "Dog",    "name":  "Lassie",      "fur_color":  "brown",    "owner":  "http://example.org/people/98765432"},   {"self":  "http://example.org/dogs/12345679",      "type":  "Dog",    "name":  "Lassie",      "fur_color":  "brown",    "owner":  "http://example.org/people/98765432"}   ]   }   15 ©2015 Apigee. All Rights Reserved.
  • 16. ©2015 Apigee Corp. All Rights Reserved. A File in Google Drive {   "kind":  "drive#file",   "id":  "1cjKSwWlryNfRs-­‐durx_8n0dGTUWE_klBrP8IuEYTUu0",   "etag":  "9vYBbk7LzzrwpsohQSOkWalvY6Y/MTQ0Mjc1ODk5NzAwMQ",   "selfLink":  "https://www.googleapis.com/drive/v2/files/1cjKSwWlryNfRs-­‐durx_8n0dGTUWE_klBrP8IuEYTUu0",   "alternateLink":  "https://docs.google.com/a/apigee.com/document/d/1cjKSwWlryNfRs-­‐durx_8n0dGTUWE_klBrP8IuEYTUu0/edit?usp=drivesdk",   "embedLink":  "https://docs.google.com/a/apigee.com/document/d/1cjKSwWlryNfRs-­‐durx_8n0dGTUWE_klBrP8IuEYTUu0/preview",   ...   "title":  "Web  API  Design  edition  2",   "mimeType":  "application/vnd.google-­‐apps.document",   ...   "createdDate":  "2015-­‐07-­‐10T15:26:34.567Z",   "modifiedDate":  "2015-­‐09-­‐20T14:23:17.001Z",   "modifiedByMeDate":  "2015-­‐09-­‐20T14:23:17.001Z",   "lastViewedByMeDate":  "2015-­‐09-­‐30T23:16:08.011Z",   "markedViewedByMeDate":  "1970-­‐01-­‐01T00:00:00.000Z",   "version":  "41819",   ...    
  • 17. ©2015 Apigee Corp. All Rights Reserved. A Folder's Children in Google Drive {   "kind":  "drive#childList",   "etag":  "9vYBbk7LzzrwpsohQSOkWalvY6Y/73yTWsreOINR667_OZQCurHB09o",   "selfLink":  "https://www.googleapis.com/drive/v2/files/0B2Pq-­‐qMI4R2jYVdudkdNMld3Vm8/children",   "items":  [    {      "kind":  "drive#childReference",      "id":  "1BuYLy9FkXpILYmwnRNetnUFCC9D-­‐U35PrJcO_9YsuW0",      "selfLink":  " https://www.googleapis.com/drive/v2/files/0B2Pq-­‐qMI4R2jYVdudkdNMld3Vm8/children/1BuYLy9FkXpILYmwnRNetnUFCC9D-­‐U35PrJcO_9YsuW0",      "childLink":  "https://www.googleapis.com/drive/v2/files/1BuYLy9FkXpILYmwnRNetnUFCC9D-­‐U35PrJcO_9YsuW0"    },    {      "kind":  "drive#childReference",      "id":  "1pfcXbfX9PaUk12Cywqav9H77-­‐DQEWhxjeKHgu1qpAi8",      "selfLink":  " https://www.googleapis.com/drive/v2/files/0B2Pq-­‐qMI4R2jYVdudkdNMld3Vm8/children/1pfcXbfX9PaUk12Cywqav9H77-­‐DQEWhxjeKHgu1qpAi8",      "childLink":  "https://www.googleapis.com/drive/v2/files/1pfcXbfX9PaUk12Cywqav9H77-­‐DQEWhxjeKHgu1qpAi8"    }   ]   }  
  • 18. ©2015 Apigee Corp. All Rights Reserved. Principles Illustrated •  Use JSON •  Keep your JSON simple and flat •  Links can be simple properties •  Collections are resources too •  Provide a "self" property •  Provide a "kind" property
  • 19. ©2015 Apigee Corp. All Rights Reserved. Perma-links Versus ‘Query URLs’ 'Query URLs': http://example.org/?type=Person&id=personID   http://example.org/people/{personId}   http://example.org/people/{personName} vs Perma-links http://example.org/cGVyc29uczt7cGVyc29uX2lkfS9kb2dz    
  • 20. ©2015 Apigee Corp. All Rights Reserved. API Versioning
  • 21. ©2015 Apigee Corp. All Rights Reserved. The Most Complex Form of Versioning •  Multiple versions of the same resource are available simultaneously •  Client selects the version it needs •  Cons: –  It is expensive to implement –  It doesn’t always work anyway •  Pros: –  Supports frequent versioning •  Very few people actually do this
  • 22. ©2015 Apigee Corp. All Rights Reserved. Why Doesn’t It Always Work? •  It doesn't work if you make substantial data-model changes – You won’t be able to update through the old versions •  It doesn't work for micro-services – Consider: •  /v1/orders/123456   •  /v2/accounts/9876765   – Now consider: •  /v2/recent_changes   – Should it include v1 format of orders, " or v2 format of orders?
  • 23. ©2015 Apigee Corp. All Rights Reserved. Pragmatic Versioning •  Only one version of each resource available at any one time –  Make sure clients can tolerate minor changes •  Version upgrade is infrequent – Major breaking change •  Less elegant version: – https://api.acmecorp.com/orders/v1/123456   – https://api.acmecorp.com/orders/v2/123456   •  Elegant version – the ‘no-versioning’ strategy for versioning – https://api.acmecorp.com/orders/123456   – https://api2.acmecorp.com/orders/123456  
  • 24. ©2015 Apigee Corp. All Rights Reserved. Summary •  Data-oriented APIs •  Simple, flat JSON •  Hypermedia –  Hypermedia links can be simple JSON properties •  Simple collections that are also resources •  Simple, ‘no versioning’ versioning strategy
  • 25. Thank you Martin Nally @mpnally Marsh Gardiner @earth2marsh