The document describes Napster's REST API. Napster provides a REST API for developers to access its music catalog and build applications. The API allows searching, retrieving metadata and streaming music. The API team is small with 6 members and started the project in July, releasing the first version in January for the CES event. The API documentation is available at http://developer.napster.com/docs/.
2. Napster We are a Best Buy company We are the best deal on the internet $5 a month for 5 downloadable MP3s + Unlimited streaming of 10million tracks We have a brand new site http://music.napster.com We have a live REST API since January http://developer.napster.com We are actively working on putting the music on Phones, Bluray Players, IPTVs & pretty much all the connected devices We are also working with developers to create music apps one app so far (http://twt.fm) The API team is a small agile team of 6 We started the project in July and released the first version for the CES at January
3. Agenda What’s REST? Quick tutorial on REST Four guiding principles of REST JAX-RS Specification Implementations Napster REST API Demo Napster REST API Architecture Security Response Format Caching Error Handling Versioning Continuous Integration
4. Agenda What’s REST? Quick tutorial on REST Four guiding principles of REST JAX-RS Specification Implementations Napster REST API Demo Napster REST API Architecture Security Response Format Caching Error Handling Versioning Continuous Integration
5. REST Representational State Transfer www.library.com User requests a Resource using URL http://www.library.com/books /books /175 – Effective Java 2nd – Josh Bloch /952 – Windows MFC – Jeff Prosise /319 – C++ Programming – Bjarne Stroustrup /367 – UML Distilled – Martin Fowler /361 – Beginning Oracle – Tom Kyte /245 – Doman Driven Design – Eric Evans /298 – Lucene in Action – Erik Hatcher /395 – Ext GWT RIA – Grant Slender /392 – Tomcat 6 – Vivek Chopra /281 – RESTful Services – Sam Ruby A Representation of the Resource is returned, and thus placing the client application in a State. The Representation contains hyperlinks to other related Resources (individual books). User clicks a hyperlink on the page A Representation of another Resource is returned, and thus causing a Transfer of client application State This constant Transfer in client’s State through various Representations is “Representational State Transfer”
6. REST Roy Fielding introduced REST Architectural Style for distributed hypermedia systems
7. What is an ‘Architectural Style’? An Architectural style is way of classifying architectures based on a set of “architectural constraints” Gothic Architecture: The ‘Clustered Columns’, ‘Pointed Ribbed Vaults’ and the ‘Flying Buttresses’ makes this a Gothic Architecture
24. Agenda What’s REST? Quick tutorial on REST Four guiding principles of REST JAX-RS Specification Implementations Napster REST API Demo Napster REST API Architecture Security Response Format Caching Error Handling Versioning Continuous Integration
25. JAX-RS Specification Defines a set of Java APIs for development of Web Services build according to the REST architectural style. Goals: POJO Based - Provides a set of annotations and associated classes/interfaces that can be used with POJOs to expose them as Web Resources. HTTP Centric - Provide clear mappings between HTTP & URI elements and corresponding API classes and annotations Format Independent - Provide necessary pluggability of content types Container Independent - Artifacts using the API will be deployable in a variety of web-tier containers
26. JAX-RS Implementations (as quoted by some one else) there's a strange phenomenon regarding buses: you wait ages for one, then three come along at once! The same seems to be true for JAX-RS implementations. At the moment we have: Restlet probably the first REST framework, which existed prior to JAX-RS CXF which is a merger between XFire and Celtix (an Open Source ESB, sponsored by IONA and originally hosted at ObjectWeb) Jersey the JAX-RS Reference Implementation from Sun RESTEasy JBoss's JAX-RS project
27. Agenda What’s REST? Introduction SOAP vs REST JAX-RS Specification Implementations Napster REST API Demo Napster REST API Architecture Security Response Format Caching Error Handling Versioning Continuous Integration
86. The API opens the door to many different device browser platforms like Konfabulator (the Yahoo Widget Library) or other embedded proprietary browsers