SlideShare ist ein Scribd-Unternehmen logo
1 von 64
Napster REST API
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
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
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
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”
REST Roy Fielding introduced REST Architectural Style for distributed hypermedia systems
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
REST Architectural Style Constraints ,[object Object]
Stateless – no client context stored on server
Cacheable – responses must define themselves as cacheable or not
Layered System – intermediary servers for load balancing, shared caches and enforce security
Code on Demand (optional) – customize client functionality by transferring logic (applets or javascript)
Uniform Interface – (next slide)  ,[object Object]
Individual resources are identified in requests using URIs
Manipulation of Resources
Resources are manipulated using a fixed set of four create, read, update, delete operations: PUT, GET, POST, and DELETE
Self descriptive messages
Each message includes enough information on how to process the message. Responses also indicate their cacheability.
Hypermedia As The Engine Of the Application State   (HATEOAS)
Related resources should be identified in the representation returned by providing their URIs,[object Object]
SOAP vs REST SOAP Coffee Request POST /askCoffeePolitelyHTTP/1.1 Host: www.coffee.com Content-Type: application/soap+xml; charset=utf-8 Content-Length: 100 <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Bodyxmlns:m="http://www.coffee.com/askCoffeePolitely"> <m:GetCoffee>     <m:NumberOfCoffees>1</m:NumberOfCoffees>   </m:GetCoffee> </soap:Body> </soap:Envelope> REST Coffee Request  GET /askCoffeePolitely/coffee?numberOfCoffees=1 HTTP/1.1 Host: www.coffee.com
SOAP vs REST
Big advantage of REST Your REST API
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
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
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
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
To get started on the API ,[object Object]
Signin using your napster account (or) Signup for a new account
Generate an API Key from [Keys & Account Info] section
Use this Excel sheet
Napster_API_Test_Console_Excel.xls
and copy/paste your API Key into the apiKey cell
Create a SessionKey
by clicking the CreateSession
and copy/paste your Session Key into sessionKey cell
Now you can access all the REST API Services (Resources) and get their XML/JSON representation,[object Object]
Genre
Album
Artist
Track
Radio
Automix
Napster Playlists
Staff Picks
Image
SecurityPrivate API ,[object Object]
User
Track (playTrack)
BillboardFull API documentation is at the Portal  http://developer.napster.com/docs/
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
Napster REST API Architecture Security Caching Response Format Error Handling Versioning Continuous Integration
Quick note: We put our Request details in ThreadLocal variables so that we don’t have to pass it around in method parameters ,[object Object],[object Object]
Security – API Key / Session Key ,[object Object]
Generated by Developer Portal per Application
To be kept “SECRET”
To be used through Secure protocol (https://) only
Unchanging, it never Expires
Session Keys are
Generated by the Applications by calling “CreateSession” or “Login” APIs
Validated for all incoming API requests (except CreateSession, Login)
Can be used in an Unsecured protocol (http)
Good for only 6 hours, it Expires,[object Object]
For Selected Developers or Partners their API      Key is given access to  ,[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Past, Present and Future of APIs of Mobile and Web Apps
Past, Present and Future of APIs of Mobile and Web AppsPast, Present and Future of APIs of Mobile and Web Apps
Past, Present and Future of APIs of Mobile and Web AppsSmartBear
 
The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2Apigee | Google Cloud
 
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...Apigee | Google Cloud
 
Design API using RAML - basics
Design API using RAML - basicsDesign API using RAML - basics
Design API using RAML - basicskunal vishe
 
Building a non-blocking REST API in less than 30 minutes
Building a non-blocking REST API in less than 30 minutesBuilding a non-blocking REST API in less than 30 minutes
Building a non-blocking REST API in less than 30 minutesThomas Meijers
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUDPrem Sanil
 
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)Apigee | Google Cloud
 
REST-API's for architects and managers
REST-API's for architects and managersREST-API's for architects and managers
REST-API's for architects and managersPatrick Savalle
 
RAML - The architecture
RAML  - The architectureRAML  - The architecture
RAML - The architectureAnkush Sharma
 
REST API Doc Best Practices
REST API Doc Best PracticesREST API Doc Best Practices
REST API Doc Best PracticesMarta Rauch
 
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...CA API Management
 
Spring Social - Messaging Friends & Influencing People
Spring Social - Messaging Friends & Influencing PeopleSpring Social - Messaging Friends & Influencing People
Spring Social - Messaging Friends & Influencing PeopleGordon Dickens
 
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...CA API Management
 
Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Patrick Savalle
 

Was ist angesagt? (20)

Past, Present and Future of APIs of Mobile and Web Apps
Past, Present and Future of APIs of Mobile and Web AppsPast, Present and Future of APIs of Mobile and Web Apps
Past, Present and Future of APIs of Mobile and Web Apps
 
RAML
RAMLRAML
RAML
 
The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2
 
Raml part 1
Raml part 1Raml part 1
Raml part 1
 
Building REST and Hypermedia APIs with PHP
Building REST and Hypermedia APIs with PHPBuilding REST and Hypermedia APIs with PHP
Building REST and Hypermedia APIs with PHP
 
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
 
Design API using RAML - basics
Design API using RAML - basicsDesign API using RAML - basics
Design API using RAML - basics
 
Building a non-blocking REST API in less than 30 minutes
Building a non-blocking REST API in less than 30 minutesBuilding a non-blocking REST API in less than 30 minutes
Building a non-blocking REST API in less than 30 minutes
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
API Design- Best Practices
API Design-   Best PracticesAPI Design-   Best Practices
API Design- Best Practices
 
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
 
REST-API's for architects and managers
REST-API's for architects and managersREST-API's for architects and managers
REST-API's for architects and managers
 
RAML - The architecture
RAML  - The architectureRAML  - The architecture
RAML - The architecture
 
Raml part 2
Raml part 2Raml part 2
Raml part 2
 
REST API Doc Best Practices
REST API Doc Best PracticesREST API Doc Best Practices
REST API Doc Best Practices
 
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
 
Spring Social - Messaging Friends & Influencing People
Spring Social - Messaging Friends & Influencing PeopleSpring Social - Messaging Friends & Influencing People
Spring Social - Messaging Friends & Influencing People
 
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
 
Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)
 
Day03 api
Day03   apiDay03   api
Day03 api
 

Andere mochten auch

socal codecamp java devops
socal codecamp java devopssocal codecamp java devops
socal codecamp java devopsstephenbhadran
 
SBJUG - Building Beautiful Batch Jobs
SBJUG - Building Beautiful Batch JobsSBJUG - Building Beautiful Batch Jobs
SBJUG - Building Beautiful Batch Jobsstephenbhadran
 
eBook piracy - Waiting for a napster moment
eBook piracy - Waiting for anapster momenteBook piracy - Waiting for anapster moment
eBook piracy - Waiting for a napster momentMathias Klang
 
A&M Records Inc v Napster
A&M Records Inc v NapsterA&M Records Inc v Napster
A&M Records Inc v NapsterBhaumik Oza
 
Napster killed itil
Napster killed itilNapster killed itil
Napster killed itilcraggles10
 
Linus Lee: Napster And Inequality
Linus Lee: Napster And InequalityLinus Lee: Napster And Inequality
Linus Lee: Napster And Inequalitymerlyna
 
Napster and Mp3: Redefining the music industry
Napster and Mp3: Redefining the music industryNapster and Mp3: Redefining the music industry
Napster and Mp3: Redefining the music industryPuneet Arora
 

Andere mochten auch (10)

socal codecamp java devops
socal codecamp java devopssocal codecamp java devops
socal codecamp java devops
 
SBJUG - Building Beautiful Batch Jobs
SBJUG - Building Beautiful Batch JobsSBJUG - Building Beautiful Batch Jobs
SBJUG - Building Beautiful Batch Jobs
 
eBook piracy - Waiting for a napster moment
eBook piracy - Waiting for anapster momenteBook piracy - Waiting for anapster moment
eBook piracy - Waiting for a napster moment
 
A&M Records Inc v Napster
A&M Records Inc v NapsterA&M Records Inc v Napster
A&M Records Inc v Napster
 
Ww Napster Mobile
Ww Napster MobileWw Napster Mobile
Ww Napster Mobile
 
Napster killed itil
Napster killed itilNapster killed itil
Napster killed itil
 
Napster
NapsterNapster
Napster
 
Linus Lee: Napster And Inequality
Linus Lee: Napster And InequalityLinus Lee: Napster And Inequality
Linus Lee: Napster And Inequality
 
P2p Peer To Peer Introduction
P2p Peer To Peer IntroductionP2p Peer To Peer Introduction
P2p Peer To Peer Introduction
 
Napster and Mp3: Redefining the music industry
Napster and Mp3: Redefining the music industryNapster and Mp3: Redefining the music industry
Napster and Mp3: Redefining the music industry
 

Ähnlich wie LAJUG Napster REST API

Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIsAparna Sharma
 
Weekly Tech Session
Weekly Tech SessionWeekly Tech Session
Weekly Tech SessionPravin Vaja
 
KaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: IntroductionKaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: IntroductionKate_RESTful
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Jackson F. de A. Mafra
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?Aparna Sharma
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni InturiSreeni I
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registrydeimos
 
zendframework2 restful
zendframework2 restfulzendframework2 restful
zendframework2 restfultom_li
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningArul ChristhuRaj Alphonse
 
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Pete Morano
 
Role of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EIRole of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EIWSO2
 
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Kevin Lee
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonAdnan Masood
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopJimmy Guerrero
 

Ähnlich wie LAJUG Napster REST API (20)

Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIs
 
Rest web service
Rest web serviceRest web service
Rest web service
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
Weekly Tech Session
Weekly Tech SessionWeekly Tech Session
Weekly Tech Session
 
KaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: IntroductionKaTe RESTful adapter for SAP Process Integration: Introduction
KaTe RESTful adapter for SAP Process Integration: Introduction
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
Rest overview briefing
Rest  overview briefingRest  overview briefing
Rest overview briefing
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registry
 
zendframework2 restful
zendframework2 restfulzendframework2 restful
zendframework2 restful
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
 
REST full API Design
REST full API DesignREST full API Design
REST full API Design
 
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
 
Role of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EIRole of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EI
 
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
 

Kürzlich hochgeladen

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 

Kürzlich hochgeladen (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 

LAJUG Napster REST API

  • 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
  • 8.
  • 9. Stateless – no client context stored on server
  • 10. Cacheable – responses must define themselves as cacheable or not
  • 11. Layered System – intermediary servers for load balancing, shared caches and enforce security
  • 12. Code on Demand (optional) – customize client functionality by transferring logic (applets or javascript)
  • 13.
  • 14. Individual resources are identified in requests using URIs
  • 16. Resources are manipulated using a fixed set of four create, read, update, delete operations: PUT, GET, POST, and DELETE
  • 18. Each message includes enough information on how to process the message. Responses also indicate their cacheability.
  • 19. Hypermedia As The Engine Of the Application State (HATEOAS)
  • 20.
  • 21. SOAP vs REST SOAP Coffee Request POST /askCoffeePolitelyHTTP/1.1 Host: www.coffee.com Content-Type: application/soap+xml; charset=utf-8 Content-Length: 100 <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Bodyxmlns:m="http://www.coffee.com/askCoffeePolitely"> <m:GetCoffee> <m:NumberOfCoffees>1</m:NumberOfCoffees> </m:GetCoffee> </soap:Body> </soap:Envelope> REST Coffee Request GET /askCoffeePolitely/coffee?numberOfCoffees=1 HTTP/1.1 Host: www.coffee.com
  • 23. Big advantage of REST Your REST API
  • 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
  • 28.
  • 29. Signin using your napster account (or) Signup for a new account
  • 30. Generate an API Key from [Keys & Account Info] section
  • 33. and copy/paste your API Key into the apiKey cell
  • 35. by clicking the CreateSession
  • 36. and copy/paste your Session Key into sessionKey cell
  • 37.
  • 38. Genre
  • 39. Album
  • 41. Track
  • 42. Radio
  • 46. Image
  • 47.
  • 48. User
  • 50. BillboardFull API documentation is at the Portal  http://developer.napster.com/docs/
  • 51. 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
  • 52. Napster REST API Architecture Security Caching Response Format Error Handling Versioning Continuous Integration
  • 53.
  • 54.
  • 55. Generated by Developer Portal per Application
  • 56. To be kept “SECRET”
  • 57. To be used through Secure protocol (https://) only
  • 60. Generated by the Applications by calling “CreateSession” or “Login” APIs
  • 61. Validated for all incoming API requests (except CreateSession, Login)
  • 62. Can be used in an Unsecured protocol (http)
  • 63.
  • 64.
  • 65. One or more Media Types (MP3, MP4, AAC, etc)API Developer/Partner API Keys Private APIs Media Types
  • 67. Interceptor to Authorize Restricted Services
  • 68. Security Caching Response Format Error Handling Versioning Continuous Integration
  • 70. Model class with JAXB Annotations
  • 71. Utility to build XML/JSON responses
  • 72. Response Output We currently support XML, JSON & JSON-P formats
  • 73.
  • 75. To over come cross domain restriction with this hack:
  • 76. varurl = http://api.napster.com:8080/rest/1.1/genres/1 ?format=json&callback=displayGenreDetails&sessionKey=BPGVjLGpzc
  • 77.
  • 78. Security Caching Response Format Error Handling Versioning Continuous Integration
  • 79. Utility to build XML/JSON responses
  • 80. Utility refactored to set Cache Headers New method New method
  • 81. Response Cache Headers Cache Headers
  • 82.
  • 83. If the hyperlink in your responses contain session tracking information then you can’t cache this and reuse for other sessions
  • 84. So, make sure the Cacheable responses don’t carry any session specific information
  • 85. Sometimes, you don’t know the browser using your API
  • 86. The API opens the door to many different device browser platforms like Konfabulator (the Yahoo Widget Library) or other embedded proprietary browsers
  • 87.
  • 88. The Exception Class Root Exception Class Sub class
  • 91. Error Handling / Error Format XML JSON
  • 92.
  • 93.
  • 94.
  • 95. When do we make a minor version?
  • 96. When do we make a major version?
  • 97. How long are we going to be backward compatible?
  • 98. How do we guarantee that this new fix is not a breaking change?
  • 99.
  • 101. When do we make a minor/major version?
  • 102. We are going to try hard to NOT make new versions by
  • 103. defining the response tag elements right the first time
  • 104. adding newer elements to the tail end of tag
  • 105. We make a new version only when we have a breaking change
  • 106. How long are we going to be backward compatible?
  • 107. Let’s shoot forever, if we are lucky enough we’ll drop older versions
  • 108. How do we guarantee that this small fix doesn’t break anything?
  • 109. 70 APIs, 2 Versions, 2 Formats, 5 Different Country Codes
  • 110. that’s 70 x 2 x 2 x 5 = 1400 tests (a little exaggeration there)
  • 111. Are these any external factors that could affect our older versions?
  • 112.
  • 113. Keeping all the code base in one place without any branching so that its easier to code, maintain, refactor, debug
  • 114.
  • 116. Napster REST API Architecture Security Caching Response Format Error Handling Versioning Continuous Integration
  • 117. Continuous Integration API QA Remote API_DEV API_QA API_AUTO_STAG API_AUTO_PROD
  • 118. SoapUI to write the test suites
  • 119. Each version has its own set of tests
  • 120. ANT Contrib to run the SoapUI projects
  • 121. Targets to run dev, qa, stag & prod tests
  • 122. Hudson to build, deploy and test…
  • 123. SoapUI produces ton of log files
  • 124.
  • 125. Make a list of failed test cases (*FAILED.txt files)
  • 126. Prepend the server URL to make clickable hyper links
  • 127. Email the TeamSubject : API_DEV - SOAPUI FAILED TESTCASES Email : 1 Test Cases Failed in 1.0 Services ===========================================   http://ci01.napster.com:8080/hudson/job/API_DEV/ws/NapsterApi/test-output/soapui/1.0/dev01/UserRestServiceTestSuite-getNewArrivals-getNewArrivals-0-FAILED.txt     2 Test Cases Failed in 1.1 Services ===========================================   http://ci01.napster.com:8080/hudson/job/API_DEV/ws/NapsterApi/test-output/soapui/1.1/dev01/PurchaseTestSuite-TestPurchaseWithCredits-PurchaseTrackUsingCredits-0-FAILED.txt http://ci01.napster.com:8080/hudson/job/API_DEV/ws/NapsterApi/test-output/soapui/1.1/dev01/RadioRestServiceTestSuite-getRadioStationTracksByStationId-getRadioStationTracksByStationId-0-FAILED.txt
  • 128. Continuous Integration API QA Remote API_DEV API_QA API_AUTO_STAG API_AUTO_PROD
  • 129. Another attempt @ mocking SOAP ...a little difficult to understand