SlideShare a Scribd company logo
A REST API for  Content Management baking semantic web access into non-geek services
Stephen Howard Athens, Georgia [email_address] http://enterity.com
a presentation in 3 acts
a presentation in 3 acts what is renao?
a presentation in 3 acts what is renao? the renao API
a presentation in 3 acts what is renao? the renao API building a community
act 1 what is renao?
renao [ren- ah -oh], adj. what is renao? From Mandarin.  Lierally " hot " but also includes "noisy," "making noise," and "stirring up trouble.” In China the term is a positive, implying " lively, festive, happy, noisy " - especially noisy! from  In Other Words  by Christopher J. Moore http://myrenao.com/what
renao [ren- ah -oh], n. A hosted content management service http://myrenao.com
content management what is renao?
content management what is renao?
design management what is renao?
design management what is renao?
flexible results what is renao?
three guiding principles what is renao?
three guiding principles what is renao? content has structure
three guiding principles what is renao? content has structure  URLs are nouns
three guiding principles what is renao? content has structure  URLs are nouns templates for many formats
1: content has structure what is renao: 3 guiding principles
1: content has structure what is renao: 3 guiding principles most organizations have collections of things (resources), physical or conceptual, that they want to publish online
1: content has structure what is renao: 3 guiding principles most organizations have collections of things (resources), physical or conceptual, that they want to publish online these resources usually have a consistent set of structured or semi-structured information
1: content has structure what is renao: 3 guiding principles most organizations have collections of things (resources), physical or conceptual, that they want to publish online these resources usually have a consistent set of structured or semi-structured information let them use these structures they’re already familiar with when adding content to their sites
1: content has structure what is renao: 3 guiding principles most organizations have collections of things (resources), physical or conceptual, that they want to publish online these resources usually have a consistent set of structured or semi-structured information let them use these structures they’re already familiar with when adding content to their sites a better format for machines to understand than flat html pages.
2: URL s are nouns what is renao: 3 guiding principles
2: URL s are nouns what is renao: 3 guiding principles URL s can refer to a specific resource http://example.com/about_us http://example.com/blog/designing_an_api
2: URL s are nouns what is renao: 3 guiding principles or a list of resources URL s can refer to a specific resource http://example.com/Articles http://example.com/about_us http://example.com/blog/designing_an_api
2: URL s are nouns what is renao: 3 guiding principles use query parameters to refine your results or a list of resources URL s can refer to a specific resource /Articles?name[like]=perl&sort=publish_date,desc http://example.com/Articles http://example.com/about_us http://example.com/blog/designing_an_api
2: URL s are nouns what is renao: 3 guiding principles or use the full-text search parameter instead http://example.com?q=perl http://example.com/blog?q=perl use query parameters to refine your results or a list of resources URL s can refer to a specific resource /Articles?name[like]=perl&sort=publish_date,desc http://example.com/Articles http://example.com/about_us http://example.com/blog/designing_an_api
2: URL s are nouns what is renao: 3 guiding principles or use the full-text search parameter instead http://example.com?q=perl http://example.com/blog?q=perl special shortcut  URL s for tags use query parameters to refine your results or a list of resources URL s can refer to a specific resource http://example.com/Articles/t/perl http://example.com/blog/t/perl /Articles?name[like]=perl&sort=publish_date,desc http://example.com/Articles http://example.com/about_us http://example.com/blog/designing_an_api
3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request:
3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request: /article.html what kind of resource is it?
3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request: /resource.html can’t find a template for that resource type? look for a template for the parent resource type. /article.html what kind of resource is it?
3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request: /articles.html is the request for a list of resources? /resource.html can’t find a template for that resource type? look for a template for the parent resource type. /article.html what kind of resource is it?
3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request: check for template / blog/article.html otherwise use  /article.html what collection is the resource in? /articles.html is the request for a list of resources? /resource.html can’t find a template for that resource type? look for a template for the parent resource type. /article.html what kind of resource is it?
3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request: ends in .xml?  -> use  /article.xml is there a specific extension on the url? check for template / blog/article.html otherwise use  /article.html what collection is the resource in? /articles.html is the request for a list of resources? /resource.html can’t find a template for that resource type? look for a template for the parent resource type. /article.html what kind of resource is it?
a presentation in 3 acts what is renao? the renao API building a community
act 2 the renao API
API  objectives the renao API
API  objectives the renao API access your own site
API  objectives the renao API access your own site write software for others to use
API  objectives the renao API access your own site write software for others to use your site is your API, no special urls
API  objectives the renao API access your own site write software for others to use your site is your API, no special urls manage content and design
API  objectives the renao API access your own site write software for others to use your site is your API, no special urls manage content and design single authentication scheme
1: access your own site the renao API: objectives
1: access your own site the renao API: objectives update your site to reflect activities around the web
1: access your own site the renao API: objectives update your site to reflect activities around the web update  other  sites and services to reflect changes on your site
1: access your own site the renao API: objectives update your site to reflect activities around the web update  other  sites and services to reflect changes on your site integrate with your own software projects
1: access your own site the renao API: objectives update your site to reflect activities around the web update  other  sites and services to reflect changes on your site integrate with your own software projects tools and shortcuts that better match how you work.
2: write software for others the renao API: objectives
2: write software for others the renao API: objectives integrate Renao into existing software
2: write software for others the renao API: objectives integrate Renao into existing software create convenience tools
2: write software for others the renao API: objectives integrate Renao into existing software create convenience tools bookmarklets
2: write software for others the renao API: objectives integrate Renao into existing software create convenience tools bookmarklets browser plugins
2: write software for others the renao API: objectives integrate Renao into existing software create convenience tools bookmarklets browser plugins desktop apps
2: write software for others the renao API: objectives integrate Renao into existing software  create convenience tools bookmarklets browser plugins desktop apps start a business
3: your site is your  API the renao API: objectives
3: your site is your  API the renao API: objectives Minimize the amount of extra code to support an API
3: your site is your  API the renao API: objectives Minimize the amount of extra code to support an API Minimize the number of API-specific urls
3: your site is your  API the renao API: objectives Minimize the amount of extra code to support an API Minimize the number of API-specific urls Use REST so talking to API users is nearly the same as talking to site visitors
4: manage content and design the renao API: objectives
4: manage content and design the renao API: objectives provide alternative interfaces for site owners
4: manage content and design the renao API: objectives provide alternative interfaces for site owners desktop apps for richer design file editing
4: manage content and design the renao API: objectives provide alternative interfaces for site owners desktop apps for richer design file editing image editors
4: manage content and design the renao API: objectives provide alternative interfaces for site owners desktop apps for richer design file editing image editors syntax highlighters
4: manage content and design the renao API: objectives provide alternative interfaces for site owners  desktop apps for richer design file editing image editors syntax highlighters file upload progress indicators
4: manage content and design the renao API: objectives provide alternative interfaces for site owners  desktop apps for richer design file editing image editors syntax highlighters file upload progress indicators implement features I wouldn’t think of, don’t have time for, or don’t want
4: manage content and design the renao API: objectives Caveat managing design files will probably violate the “no special urls” API rule.
4: manage content and design the renao API: objectives Caveat managing design files will probably violate the “no special urls” API rule. normal graphics, scripts and css directories should be: fast: no permission checks minimal server side scripting potentially: distributable across a CDN
5: single authentication scheme the renao API: objectives
5: single authentication scheme the renao API: objectives OAuth
5: single authentication scheme the renao API: objectives OAuth 3-legged provide access on behalf of another user never have to ask for or store the user’s username and password User grants you an access-token which they have the power to revoke at a later date
5: single authentication scheme the renao API: objectives OAuth 2-legged skip access-token dance send token-less OAuth requests for resources on your own sites 3-legged provide access on behalf of another user never have to ask for or store the user’s username and password User grants you an access-token which they have the power to revoke at a later date
single authentication scheme the renao API: objectives http://oauth.net/core/1.0
integrating the API the renao API session cleanup PerlCleanupHandler logging PerlLogHandler code written with REST in mind the main event PerlResponseHandler cookies or OAuth? initialize session PerlAccessHandler map url to resource(s) PerlTransHandler request_method browser fix-up map domain to site and account PerlInitHandler for  API  compatibility for all requests apache request cycle
using the renao API the renao API
using the renao API actions are HTTP Requests the renao API
using the renao API actions are HTTP Requests GET, HEAD, PUT, POST, DELETE the renao API
using the renao API actions are HTTP Requests GET, HEAD, PUT, POST, DELETE act on the URLs on your site the renao API
using the renao API actions are HTTP Requests GET, HEAD, PUT, POST, DELETE act on the URLs on your site OAuth for tasks that require authorization the renao API
using the renao API actions are HTTP Requests GET, HEAD, PUT, POST, DELETE act on the URLs on your site OAuth for tasks that require authorization account with developer key   and passcode the renao API
sometimes you can get stuff done without authenticating the renao API: examples <h3> <a href= &quot;http://myrenao.com/discuss&quot;   class= &quot;recent_topics&quot; > Recent Community Discussion Topics </a> <img src= &quot;/graphics/icons/go.png&quot;   alt= &quot;go&quot;   /> </h3> <h3> <a href= &quot; http://enterity.myrenao.com/blog &quot;   class= &quot;recent_topics&quot; > Recent Blog Posts </a> <img src= &quot;/graphics/icons/go.png&quot;   alt= &quot;go&quot;   /> </h3> (1 of 3)
sometimes you can get stuff done without authenticating the renao API: examples // JSONP request with jQuery ----------------- Widget.RecentTopics  = function( link ) { var  baseurl_regex  =  new   RegExp ( &quot;(http://[^/]+)&quot; ); var  baseurl   =  link .href. match (baseurl_regex)[ 0 ]; $. getJSON (  link .href +  '.jsonp?jsoncallback=?' , function( resources ){ for( var  i = 0 ;  i  <  resources .length;  i ++ ) { var  name  =  resources [i].subject ||  resources [i].name; $( link ). parent ().after( '<h4><a href=&quot;' + baseurl + resources [ i ].uri+ '&quot;>' + name + '</a></h4>’ ); } }) } // hook into the html ----------------- $ (function(){ $ ( 'a.recent_topics' ). each (function(){  Widget.RecentTopics ( this ); }); }); (2 of 3)
sometimes you can get stuff done without authenticating the renao API: examples [%  # template: collection.jsonp ---- cgi . param ( 'jsoncallback' );  ‘(‘ ; # get the 10 most recent resources from this collection ---- USE  Resources ; resources  =  Resources . retrieve ( 'Resource' , { inclusive  =>  1 , range  => { offset =>  0 , limit  =>  10 }, sort  => [ 'publish_date' ,  'desc' ], conditions => [ 'in' ,  'collections' ,  collection .id] }); # output each resource in json format ---- FOREACH  resource  =  resources ; PROCESS  resource.json ; ','  UNLESS  loop . last ; END; %] ) (3 of 3)
using Perl and Net::OAuth the renao API: examples use  Net::OAuth ; use  LWP::UserAgent ; use  HTTP::Request::Common ; use  Digest::MD5  qw( md5_hex ); my  $site   =  'stephen.myrenao.com' ; my  $url   =  '/blog/Articles.json'; my  $oauth_consumer_key   =  '848b9908df07dcdcb' ; my  $oauth_consumer_secret  =  '7aeaded3671776407' ;  # create OAuth Signature ----------------- my  $oauth  =  Net::OAuth -> request ( 'consumer' )-> new ( request_url  =>  $url , request_method  =>  'POST' , consumer_key  =>  $oauth_consumer_key , consumer_secret  =>  $oauth_consumer_secret , signature_method =>  'HMAC-SHA1' , timestamp  =>  time , nonce  =>  md5_hex (  $oauth_consumer_key ,  time  ), ); $oauth -> sign ; (1 of 2)
using Perl and Net::OAuth the renao API: examples # make HTTP Request ----------------- my  $response  =  LWP::UserAgent -> new -> request ( POST   &quot;http:// $site$url &quot; , Authorization =>  $oauth -> to_authorization_header , Content  => { alias  =>  'testing_oauth' , name  =>  'testing my api' , body  =>  'This is a test of the Renao API' , commentable =>  1 } ); # handle HTTP Response ----------------- print  $response -> is_success ?  &quot;successfully posted to site \n &quot; :  &quot;something went wrong \n ” ; print  $response -> status_line   .  &quot; \n ” .  $response -> decoded_content  .  &quot; \n &quot; ; (2 of 2)
future API plans the renao API
future API plans the renao API accept data in more formats
future API plans the renao API accept data in more formats use headers to determine default response format
future API plans the renao API accept data in more formats use headers to determine default response format add device/screen-size detection for template selection
1: accept data in more formats the renao API: future plans Check the content-type header on requests and parse body appropriately.
1: accept data in more formats the renao API: future plans Check the content-type header on requests and parse body appropriately.  At least support: application/x-www-form-urlencoded multipart/form-data application/json text/xml
2: use headers to determine default response format No format extension on the url? Use HTTP Accept header to determine response format the renao API: future plans http://example.com/about_us
3: device/screen-size detection the renao API: future plans
3: device/screen-size detection the renao API: future plans All devices use the same urls and domains
3: device/screen-size detection the renao API: future plans All devices use the same urls and domains Use HTTP User-Agent header to look up templates particular for the device or class of device
3: device/screen-size detection the renao API: future plans All devices use the same urls and domains Use HTTP User-Agent header to look up templates particular for the device or class of device Eliminates the need to maintain multiple copies or interfaces to your content for different devices
a presentation in 3 acts what is renao? the renao API building a community
act 3 building a community
examples building a community mashups Google Maps themes plugins Wordpress web apps desktop clients twitter desktop photo app integration web mashups extended services (printing) flickr
why build a community? building a community
why build a community? power users (designers and developers) can amplify and spread your work building a community
why build a community? power users (designers and developers) can amplify and spread your work service users can help each other out to excel at using the service to accomplish their goals building a community
why build a community? power users (designers and developers) can amplify and spread your work service users can help each other out to excel at using the service to accomplish their goals provides a group of people passionate about the service that won’t hesitate to provide an ongoing reality-check to you building a community
“ create more value than you capture” - Tim O’Reilly building a community
how to attract a community? some ideas building a community
how to attract a community? some ideas provide an online venue for the community to gather building a community
how to attract a community? some ideas provide an online venue for the community to gather cultivate an atmosphere of helpfulness among service users building a community
how to attract a community? some ideas provide an online venue for the community to gather cultivate an atmosphere of helpfulness among service users affiliate program building a community
how to attract a community? some ideas provide an online venue for the community to gather cultivate an atmosphere of helpfulness among service users affiliate program provide features that will attract power users building a community
features for power users ideas for designers building a community
features for power users ideas for designers allow for complete design flexibility building a community
features for power users ideas for designers allow for complete design flexibility user-contributed themes gallery building a community
features for power users ideas for designers allow for complete design flexibility user-contributed themes gallery free “project starter” sites for new client sites building a community
features for power users ideas for developers building a community
features for power users ideas for developers an API that is easy to understand and write for building a community
features for power users ideas for developers an API that is easy to understand and write for good API documentation building a community
features for power users ideas for developers an API that is easy to understand and write for good API documentation low barriers to getting started building a community
a presentation in 3 acts what is renao? the renao API building a community fin.
Thanks http://myrenao.com [email_address]
discussion:   how do you attract a community  around a service? http://myrenao.com [email_address]

More Related Content

PPT
20090914 Petamedia Irp5
PPT
Yahoo BOSS Presentation London Open Hack Day Talk Boss
PPTX
Timeline SoMa WADE
PPT
Hack the BOSS at Open Hack Day - London
PPT
Lecture7
PPT
Yahoo! BOSS and trainspotting
PDF
Dangerous Google searching for secrets
PDF
Digital marketing interview questions with answers by lazyhangout.com
20090914 Petamedia Irp5
Yahoo BOSS Presentation London Open Hack Day Talk Boss
Timeline SoMa WADE
Hack the BOSS at Open Hack Day - London
Lecture7
Yahoo! BOSS and trainspotting
Dangerous Google searching for secrets
Digital marketing interview questions with answers by lazyhangout.com

What's hot (9)

PDF
The Google Hacking Database: A Key Resource to Exposing Vulnerabilities
PDF
Leveraging Plone for Search Engine Optimization (SEO)
KEY
What Is Seo How Search Engine Works
PDF
Introduction to Facebook Javascript SDK (NEW)
PPTX
Learning Wordpress - the internal guide
PDF
Affiliate Marketing
PPT
Google
PDF
Kiran karnad rtc2014 ghdb-final
PDF
Research on Key Technology of Web Reptile
The Google Hacking Database: A Key Resource to Exposing Vulnerabilities
Leveraging Plone for Search Engine Optimization (SEO)
What Is Seo How Search Engine Works
Introduction to Facebook Javascript SDK (NEW)
Learning Wordpress - the internal guide
Affiliate Marketing
Google
Kiran karnad rtc2014 ghdb-final
Research on Key Technology of Web Reptile
Ad

Viewers also liked (8)

PPT
Givingawaymoney 110620025907-phpapp02
PPTX
Wcf rest api introduction
PPTX
Overview of Responsive Web Design
PPTX
Introduction to REST - API
PPT
joshua&cal sealed knot powerpoint
PPT
5th Annual Global Diversity Seminar Barcelona Abercrombie & Fitch
PPTX
Bruce-輕鬆上手Asp.net web api 2.1.2
PDF
Ormita partly media on barter(beijing, shanghai & hongkong)
Givingawaymoney 110620025907-phpapp02
Wcf rest api introduction
Overview of Responsive Web Design
Introduction to REST - API
joshua&cal sealed knot powerpoint
5th Annual Global Diversity Seminar Barcelona Abercrombie & Fitch
Bruce-輕鬆上手Asp.net web api 2.1.2
Ormita partly media on barter(beijing, shanghai & hongkong)
Ad

Similar to A REST API for Content Management (20)

PDF
99ways presentation at semtech conference 2009
KEY
Web Technology Trends (early 2009)
ZIP
The Power of Open Data
PDF
Introduction to REST and Jersey
PDF
REST Introduction (PHP London)
ZIP
REST: Theory vs Practice
PDF
Django in the Real World
PDF
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
KEY
Get ready for web3.0! Open up your app!
PPTX
A Deep Dive into RESTful API Design Part 2
PPTX
NEPHP '12: Create a RESTful API
PDF
Api design best practice
PDF
Web APIs: The future of software
PDF
Restful Web Services Cookbook 1st Edition Subbu Allamaraju
PDF
Python Ireland Nov 2010 - RESTing with Django
PDF
Rest web services
PDF
REST in Practice
PPTX
Creating Truly RESTful APIs
PPT
Linking Data and Actions on the Web
PPTX
RESTful design
99ways presentation at semtech conference 2009
Web Technology Trends (early 2009)
The Power of Open Data
Introduction to REST and Jersey
REST Introduction (PHP London)
REST: Theory vs Practice
Django in the Real World
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
Get ready for web3.0! Open up your app!
A Deep Dive into RESTful API Design Part 2
NEPHP '12: Create a RESTful API
Api design best practice
Web APIs: The future of software
Restful Web Services Cookbook 1st Edition Subbu Allamaraju
Python Ireland Nov 2010 - RESTing with Django
Rest web services
REST in Practice
Creating Truly RESTful APIs
Linking Data and Actions on the Web
RESTful design

Recently uploaded (20)

PPTX
Machine Learning_overview_presentation.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Approach and Philosophy of On baking technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Encapsulation theory and applications.pdf
Machine Learning_overview_presentation.pptx
sap open course for s4hana steps from ECC to s4
Approach and Philosophy of On baking technology
Network Security Unit 5.pdf for BCA BBA.
Spectral efficient network and resource selection model in 5G networks
A comparative analysis of optical character recognition models for extracting...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Programs and apps: productivity, graphics, security and other tools
Digital-Transformation-Roadmap-for-Companies.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Unlocking AI with Model Context Protocol (MCP)
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Electronic commerce courselecture one. Pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Assigned Numbers - 2025 - Bluetooth® Document
Encapsulation theory and applications.pdf

A REST API for Content Management

  • 1. A REST API for Content Management baking semantic web access into non-geek services
  • 2. Stephen Howard Athens, Georgia [email_address] http://enterity.com
  • 4. a presentation in 3 acts what is renao?
  • 5. a presentation in 3 acts what is renao? the renao API
  • 6. a presentation in 3 acts what is renao? the renao API building a community
  • 7. act 1 what is renao?
  • 8. renao [ren- ah -oh], adj. what is renao? From Mandarin. Lierally &quot; hot &quot; but also includes &quot;noisy,&quot; &quot;making noise,&quot; and &quot;stirring up trouble.” In China the term is a positive, implying &quot; lively, festive, happy, noisy &quot; - especially noisy! from In Other Words by Christopher J. Moore http://myrenao.com/what
  • 9. renao [ren- ah -oh], n. A hosted content management service http://myrenao.com
  • 15. three guiding principles what is renao?
  • 16. three guiding principles what is renao? content has structure
  • 17. three guiding principles what is renao? content has structure URLs are nouns
  • 18. three guiding principles what is renao? content has structure URLs are nouns templates for many formats
  • 19. 1: content has structure what is renao: 3 guiding principles
  • 20. 1: content has structure what is renao: 3 guiding principles most organizations have collections of things (resources), physical or conceptual, that they want to publish online
  • 21. 1: content has structure what is renao: 3 guiding principles most organizations have collections of things (resources), physical or conceptual, that they want to publish online these resources usually have a consistent set of structured or semi-structured information
  • 22. 1: content has structure what is renao: 3 guiding principles most organizations have collections of things (resources), physical or conceptual, that they want to publish online these resources usually have a consistent set of structured or semi-structured information let them use these structures they’re already familiar with when adding content to their sites
  • 23. 1: content has structure what is renao: 3 guiding principles most organizations have collections of things (resources), physical or conceptual, that they want to publish online these resources usually have a consistent set of structured or semi-structured information let them use these structures they’re already familiar with when adding content to their sites a better format for machines to understand than flat html pages.
  • 24. 2: URL s are nouns what is renao: 3 guiding principles
  • 25. 2: URL s are nouns what is renao: 3 guiding principles URL s can refer to a specific resource http://example.com/about_us http://example.com/blog/designing_an_api
  • 26. 2: URL s are nouns what is renao: 3 guiding principles or a list of resources URL s can refer to a specific resource http://example.com/Articles http://example.com/about_us http://example.com/blog/designing_an_api
  • 27. 2: URL s are nouns what is renao: 3 guiding principles use query parameters to refine your results or a list of resources URL s can refer to a specific resource /Articles?name[like]=perl&sort=publish_date,desc http://example.com/Articles http://example.com/about_us http://example.com/blog/designing_an_api
  • 28. 2: URL s are nouns what is renao: 3 guiding principles or use the full-text search parameter instead http://example.com?q=perl http://example.com/blog?q=perl use query parameters to refine your results or a list of resources URL s can refer to a specific resource /Articles?name[like]=perl&sort=publish_date,desc http://example.com/Articles http://example.com/about_us http://example.com/blog/designing_an_api
  • 29. 2: URL s are nouns what is renao: 3 guiding principles or use the full-text search parameter instead http://example.com?q=perl http://example.com/blog?q=perl special shortcut URL s for tags use query parameters to refine your results or a list of resources URL s can refer to a specific resource http://example.com/Articles/t/perl http://example.com/blog/t/perl /Articles?name[like]=perl&sort=publish_date,desc http://example.com/Articles http://example.com/about_us http://example.com/blog/designing_an_api
  • 30. 3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request:
  • 31. 3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request: /article.html what kind of resource is it?
  • 32. 3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request: /resource.html can’t find a template for that resource type? look for a template for the parent resource type. /article.html what kind of resource is it?
  • 33. 3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request: /articles.html is the request for a list of resources? /resource.html can’t find a template for that resource type? look for a template for the parent resource type. /article.html what kind of resource is it?
  • 34. 3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request: check for template / blog/article.html otherwise use /article.html what collection is the resource in? /articles.html is the request for a list of resources? /resource.html can’t find a template for that resource type? look for a template for the parent resource type. /article.html what kind of resource is it?
  • 35. 3: templates for many formats what is renao: 3 guiding principles how renao picks from your templates for a given request: ends in .xml? -> use /article.xml is there a specific extension on the url? check for template / blog/article.html otherwise use /article.html what collection is the resource in? /articles.html is the request for a list of resources? /resource.html can’t find a template for that resource type? look for a template for the parent resource type. /article.html what kind of resource is it?
  • 36. a presentation in 3 acts what is renao? the renao API building a community
  • 37. act 2 the renao API
  • 38. API objectives the renao API
  • 39. API objectives the renao API access your own site
  • 40. API objectives the renao API access your own site write software for others to use
  • 41. API objectives the renao API access your own site write software for others to use your site is your API, no special urls
  • 42. API objectives the renao API access your own site write software for others to use your site is your API, no special urls manage content and design
  • 43. API objectives the renao API access your own site write software for others to use your site is your API, no special urls manage content and design single authentication scheme
  • 44. 1: access your own site the renao API: objectives
  • 45. 1: access your own site the renao API: objectives update your site to reflect activities around the web
  • 46. 1: access your own site the renao API: objectives update your site to reflect activities around the web update other sites and services to reflect changes on your site
  • 47. 1: access your own site the renao API: objectives update your site to reflect activities around the web update other sites and services to reflect changes on your site integrate with your own software projects
  • 48. 1: access your own site the renao API: objectives update your site to reflect activities around the web update other sites and services to reflect changes on your site integrate with your own software projects tools and shortcuts that better match how you work.
  • 49. 2: write software for others the renao API: objectives
  • 50. 2: write software for others the renao API: objectives integrate Renao into existing software
  • 51. 2: write software for others the renao API: objectives integrate Renao into existing software create convenience tools
  • 52. 2: write software for others the renao API: objectives integrate Renao into existing software create convenience tools bookmarklets
  • 53. 2: write software for others the renao API: objectives integrate Renao into existing software create convenience tools bookmarklets browser plugins
  • 54. 2: write software for others the renao API: objectives integrate Renao into existing software create convenience tools bookmarklets browser plugins desktop apps
  • 55. 2: write software for others the renao API: objectives integrate Renao into existing software create convenience tools bookmarklets browser plugins desktop apps start a business
  • 56. 3: your site is your API the renao API: objectives
  • 57. 3: your site is your API the renao API: objectives Minimize the amount of extra code to support an API
  • 58. 3: your site is your API the renao API: objectives Minimize the amount of extra code to support an API Minimize the number of API-specific urls
  • 59. 3: your site is your API the renao API: objectives Minimize the amount of extra code to support an API Minimize the number of API-specific urls Use REST so talking to API users is nearly the same as talking to site visitors
  • 60. 4: manage content and design the renao API: objectives
  • 61. 4: manage content and design the renao API: objectives provide alternative interfaces for site owners
  • 62. 4: manage content and design the renao API: objectives provide alternative interfaces for site owners desktop apps for richer design file editing
  • 63. 4: manage content and design the renao API: objectives provide alternative interfaces for site owners desktop apps for richer design file editing image editors
  • 64. 4: manage content and design the renao API: objectives provide alternative interfaces for site owners desktop apps for richer design file editing image editors syntax highlighters
  • 65. 4: manage content and design the renao API: objectives provide alternative interfaces for site owners desktop apps for richer design file editing image editors syntax highlighters file upload progress indicators
  • 66. 4: manage content and design the renao API: objectives provide alternative interfaces for site owners desktop apps for richer design file editing image editors syntax highlighters file upload progress indicators implement features I wouldn’t think of, don’t have time for, or don’t want
  • 67. 4: manage content and design the renao API: objectives Caveat managing design files will probably violate the “no special urls” API rule.
  • 68. 4: manage content and design the renao API: objectives Caveat managing design files will probably violate the “no special urls” API rule. normal graphics, scripts and css directories should be: fast: no permission checks minimal server side scripting potentially: distributable across a CDN
  • 69. 5: single authentication scheme the renao API: objectives
  • 70. 5: single authentication scheme the renao API: objectives OAuth
  • 71. 5: single authentication scheme the renao API: objectives OAuth 3-legged provide access on behalf of another user never have to ask for or store the user’s username and password User grants you an access-token which they have the power to revoke at a later date
  • 72. 5: single authentication scheme the renao API: objectives OAuth 2-legged skip access-token dance send token-less OAuth requests for resources on your own sites 3-legged provide access on behalf of another user never have to ask for or store the user’s username and password User grants you an access-token which they have the power to revoke at a later date
  • 73. single authentication scheme the renao API: objectives http://oauth.net/core/1.0
  • 74. integrating the API the renao API session cleanup PerlCleanupHandler logging PerlLogHandler code written with REST in mind the main event PerlResponseHandler cookies or OAuth? initialize session PerlAccessHandler map url to resource(s) PerlTransHandler request_method browser fix-up map domain to site and account PerlInitHandler for API compatibility for all requests apache request cycle
  • 75. using the renao API the renao API
  • 76. using the renao API actions are HTTP Requests the renao API
  • 77. using the renao API actions are HTTP Requests GET, HEAD, PUT, POST, DELETE the renao API
  • 78. using the renao API actions are HTTP Requests GET, HEAD, PUT, POST, DELETE act on the URLs on your site the renao API
  • 79. using the renao API actions are HTTP Requests GET, HEAD, PUT, POST, DELETE act on the URLs on your site OAuth for tasks that require authorization the renao API
  • 80. using the renao API actions are HTTP Requests GET, HEAD, PUT, POST, DELETE act on the URLs on your site OAuth for tasks that require authorization account with developer key and passcode the renao API
  • 81. sometimes you can get stuff done without authenticating the renao API: examples <h3> <a href= &quot;http://myrenao.com/discuss&quot; class= &quot;recent_topics&quot; > Recent Community Discussion Topics </a> <img src= &quot;/graphics/icons/go.png&quot; alt= &quot;go&quot; /> </h3> <h3> <a href= &quot; http://enterity.myrenao.com/blog &quot; class= &quot;recent_topics&quot; > Recent Blog Posts </a> <img src= &quot;/graphics/icons/go.png&quot; alt= &quot;go&quot; /> </h3> (1 of 3)
  • 82. sometimes you can get stuff done without authenticating the renao API: examples // JSONP request with jQuery ----------------- Widget.RecentTopics = function( link ) { var baseurl_regex = new RegExp ( &quot;(http://[^/]+)&quot; ); var baseurl = link .href. match (baseurl_regex)[ 0 ]; $. getJSON ( link .href + '.jsonp?jsoncallback=?' , function( resources ){ for( var i = 0 ; i < resources .length; i ++ ) { var name = resources [i].subject || resources [i].name; $( link ). parent ().after( '<h4><a href=&quot;' + baseurl + resources [ i ].uri+ '&quot;>' + name + '</a></h4>’ ); } }) } // hook into the html ----------------- $ (function(){ $ ( 'a.recent_topics' ). each (function(){ Widget.RecentTopics ( this ); }); }); (2 of 3)
  • 83. sometimes you can get stuff done without authenticating the renao API: examples [% # template: collection.jsonp ---- cgi . param ( 'jsoncallback' ); ‘(‘ ; # get the 10 most recent resources from this collection ---- USE Resources ; resources = Resources . retrieve ( 'Resource' , { inclusive => 1 , range => { offset => 0 , limit => 10 }, sort => [ 'publish_date' , 'desc' ], conditions => [ 'in' , 'collections' , collection .id] }); # output each resource in json format ---- FOREACH resource = resources ; PROCESS resource.json ; ',' UNLESS loop . last ; END; %] ) (3 of 3)
  • 84. using Perl and Net::OAuth the renao API: examples use Net::OAuth ; use LWP::UserAgent ; use HTTP::Request::Common ; use Digest::MD5 qw( md5_hex ); my $site = 'stephen.myrenao.com' ; my $url = '/blog/Articles.json'; my $oauth_consumer_key = '848b9908df07dcdcb' ; my $oauth_consumer_secret = '7aeaded3671776407' ; # create OAuth Signature ----------------- my $oauth = Net::OAuth -> request ( 'consumer' )-> new ( request_url => $url , request_method => 'POST' , consumer_key => $oauth_consumer_key , consumer_secret => $oauth_consumer_secret , signature_method => 'HMAC-SHA1' , timestamp => time , nonce => md5_hex ( $oauth_consumer_key , time ), ); $oauth -> sign ; (1 of 2)
  • 85. using Perl and Net::OAuth the renao API: examples # make HTTP Request ----------------- my $response = LWP::UserAgent -> new -> request ( POST &quot;http:// $site$url &quot; , Authorization => $oauth -> to_authorization_header , Content => { alias => 'testing_oauth' , name => 'testing my api' , body => 'This is a test of the Renao API' , commentable => 1 } ); # handle HTTP Response ----------------- print $response -> is_success ? &quot;successfully posted to site \n &quot; : &quot;something went wrong \n ” ; print $response -> status_line . &quot; \n ” . $response -> decoded_content . &quot; \n &quot; ; (2 of 2)
  • 86. future API plans the renao API
  • 87. future API plans the renao API accept data in more formats
  • 88. future API plans the renao API accept data in more formats use headers to determine default response format
  • 89. future API plans the renao API accept data in more formats use headers to determine default response format add device/screen-size detection for template selection
  • 90. 1: accept data in more formats the renao API: future plans Check the content-type header on requests and parse body appropriately.
  • 91. 1: accept data in more formats the renao API: future plans Check the content-type header on requests and parse body appropriately. At least support: application/x-www-form-urlencoded multipart/form-data application/json text/xml
  • 92. 2: use headers to determine default response format No format extension on the url? Use HTTP Accept header to determine response format the renao API: future plans http://example.com/about_us
  • 93. 3: device/screen-size detection the renao API: future plans
  • 94. 3: device/screen-size detection the renao API: future plans All devices use the same urls and domains
  • 95. 3: device/screen-size detection the renao API: future plans All devices use the same urls and domains Use HTTP User-Agent header to look up templates particular for the device or class of device
  • 96. 3: device/screen-size detection the renao API: future plans All devices use the same urls and domains Use HTTP User-Agent header to look up templates particular for the device or class of device Eliminates the need to maintain multiple copies or interfaces to your content for different devices
  • 97. a presentation in 3 acts what is renao? the renao API building a community
  • 98. act 3 building a community
  • 99. examples building a community mashups Google Maps themes plugins Wordpress web apps desktop clients twitter desktop photo app integration web mashups extended services (printing) flickr
  • 100. why build a community? building a community
  • 101. why build a community? power users (designers and developers) can amplify and spread your work building a community
  • 102. why build a community? power users (designers and developers) can amplify and spread your work service users can help each other out to excel at using the service to accomplish their goals building a community
  • 103. why build a community? power users (designers and developers) can amplify and spread your work service users can help each other out to excel at using the service to accomplish their goals provides a group of people passionate about the service that won’t hesitate to provide an ongoing reality-check to you building a community
  • 104. “ create more value than you capture” - Tim O’Reilly building a community
  • 105. how to attract a community? some ideas building a community
  • 106. how to attract a community? some ideas provide an online venue for the community to gather building a community
  • 107. how to attract a community? some ideas provide an online venue for the community to gather cultivate an atmosphere of helpfulness among service users building a community
  • 108. how to attract a community? some ideas provide an online venue for the community to gather cultivate an atmosphere of helpfulness among service users affiliate program building a community
  • 109. how to attract a community? some ideas provide an online venue for the community to gather cultivate an atmosphere of helpfulness among service users affiliate program provide features that will attract power users building a community
  • 110. features for power users ideas for designers building a community
  • 111. features for power users ideas for designers allow for complete design flexibility building a community
  • 112. features for power users ideas for designers allow for complete design flexibility user-contributed themes gallery building a community
  • 113. features for power users ideas for designers allow for complete design flexibility user-contributed themes gallery free “project starter” sites for new client sites building a community
  • 114. features for power users ideas for developers building a community
  • 115. features for power users ideas for developers an API that is easy to understand and write for building a community
  • 116. features for power users ideas for developers an API that is easy to understand and write for good API documentation building a community
  • 117. features for power users ideas for developers an API that is easy to understand and write for good API documentation low barriers to getting started building a community
  • 118. a presentation in 3 acts what is renao? the renao API building a community fin.
  • 120. discussion: how do you attract a community around a service? http://myrenao.com [email_address]