Your visitors interact with content, not with your website. Content consistency is crucial to a successful user experience. Re-publishing is one option but it’s an inside-out action that relies on the authority controlling where the information goes. An API frees your data and the responsibility to where it is published and accessed. Mobile is a major consumer for your API but not every API is setup to handle the mass of requests coming from those devices. Learn how to mobile devices consume API’s with limited or low bandwidth and how to to tailor your API to be as efficient and effective as possible.
http://environmentsforhumans.com/2012/doteduguru-summit/
2. @nickdenardis
Associate Director of Web Communications
Wayne State University
http://wayne.edu/
Host of EDU Checkup
http://educheckup.com/
Curator of EDU Snippits
http://edusnippits.com/
Writer for .eduGuru
http://doteduguru.com/
3. Disclaimer
This talk is less about how to code an API but
more about the strategy behind creating a
flexible and resilient API.
20. One size != fit all
https://api.twitter.com/1/
https://us2.api.mailchimp.com/1.3/
https://api.foursquare.com/v2/
https://api.instagram.com/v1/
https://www.salesforce.com/services/Soap/c/18.0
https://api.wayne.edu/v1/
Think versioning from the start
21. SOAP REST
The request: The request:
GET /StockPrice HTTP/1.1 GET /StockPrice/IBM HTTP/1.1
Host: example.org Host: example.org
Content-Type: application/soap+xml; charset=utf-8 Accept: text/xml
Content-Length: nnn Accept-Charset: utf-8
<?xml version="1.0"?> The response:
<env:Envelope xmlns:env="http://www.w3.org/
2003/05/soap-envelope" HTTP/1.1 200 OK
xmlns:s="http://www.example.org/stock-service"> Content-Type: text/xml; charset=utf-8
<env:Body> Content-Length: nnn
<s:GetStockQuote>
<s:TickerSymbol>IBM</s:TickerSymbol> <?xml version="1.0"?>
</s:GetStockQuote> <s:Quote xmlns:s="http://example.org/stock-
</env:Body> service">
</env:Envelope> <s:TickerSymbol>IBM</s:TickerSymbol>
<s:StockPrice>45.25</s:StockPrice>
The response: </s:Quote>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/
2003/05/soap-envelope"
xmlns:s="http://www.example.org/stock-service">
<env:Body>
<s:GetStockQuoteResponse>
<s:StockPrice>45.25</s:StockPrice>
</s:GetStockQuoteResponse>
</env:Body>
4 kb vs 2 kb
</env:Envelope>
Round Trip
26. Not everything is in the CMS
Website
CMS
Gather &
Clean
Mobile
Website
Events
Shadow
storage
Mobile
App
LDAP
API
Webserver
Digital
Signage
Banner
Third
Party
44. HTML5 localStorage
if (typeof(localStorage) == 'undefined' ) {
alert('Your browser does not support HTML5 localStorage. Try upgrading.');
} else {
try {
localStorage.setItem("name", "Hello World!"); //saves to the database,
} catch (e) {
if (e == QUOTA_EXCEEDED_ERR) {
alert('Quota exceeded!'); //data wasn't successfully saved due to quota exceed
so throw an error
}
}
document.write(localStorage.getItem("name")); //Hello World!
localStorage.removeItem("name"); //deletes the matching item from the database
}
http://paperkilledrock.com/2010/05/html5-localstorage-part-one/
45. Expires header
<?php
header('Expires: '.gmdate('D, d M Y H:i:s GMT', time() + 3600));
?>
1 Month 1 Week 1 Day
Semesters Courses Events
Subjects Media Experts News
Degrees
Map Categories No Cache
Map Locations
Course Availability
Parking Availability
46. Our Stats
Feb 2011 - In production
2.5 million requests
48% from mobile
21% iOS
23% Android
66% Web
95% GET’s
16 ms average response time