1 / 31

Access Xbox LIVE Using RESTful Web Services

Access Xbox LIVE Using RESTful Web Services. Martin Sleeman Senior Program Manager Microsoft. Talk Overview. RESTful Service Introduction Companion Apps and RESTful Services RESTful Service overview Authorizing against Xbox LIVE Services Example of accessing a profile Demo Summary

osias
Télécharger la présentation

Access Xbox LIVE Using RESTful Web Services

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Access Xbox LIVE Using RESTful Web Services Martin Sleeman Senior Program Manager Microsoft

  2. Talk Overview • RESTful Service Introduction • Companion Apps and RESTful Services • RESTful Service overview • Authorizing against Xbox LIVE Services • Example of accessing a profile • Demo • Summary • Questions

  3. What are RESTful Services Anyways? • RESTful Services: • REST stands for Representational State Transfer • It is not a standard or a RFC, rather it is an architectural style that the leverages HTTP(s) protocol • Each unique URI is a representation of an resource • APIs based on four http verbs: GET, PUT, POST, DELETE to manipulate the resources defined by the URI • Responses can use XML or JSON • JavaScript Object Notation (JSON) • A lightweight text-based human readable open standard designed for data interchange1 1 http://en.wikipedia.org/wiki/Json

  4. Hello World RESTful Style I’m modeling a bookshelf where each book’s ISBN number is its unique book id. Let’s Get the author of a book I wrote (ISBN 12345) REQUEST GET http://www.contoso.com/books/book_isbn({12345})/author HTTP/1.1 Host: contoso.com … RESPONSE HTTP/1.1 200 OK … Date: Mon, 27 Jun 2011 16:08:26 GMT Server: Microsoft-IIS/7.0 … { "author": "Martin Sleeman" }

  5. Updating an Author RESTfully Let’s update name of that author by putting a new value there. REQUEST PUT http://www.contoso.com/books/book_isbn({12345})/author HTTP/1.1 User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) Host: contoso.com … Martin John Sleeman RESPONSE HTTP/1.1 200 OK Proxy-Connection: Keep-Alive Connection: Keep-Alive Date: Mon, 27 Jun 2011 16:08:26 GMT Server: Microsoft-IIS/7.0 …

  6. RESTful Access to Xbox LIVE • Why support RESTful Services? • Simple and easy to use (just construct URLs with sprintf) • Many clients speak HTTPS • Easy cross platform communication • We can innovate and & release services more quickly • It scales and caches very well • Focuses design on the cloud with multiple screens • How can they help me? • 3 screen Title Managed Storage • 3 screen Asynchronous multiplayer

  7. Companion Games • Companion games extend franchises • Mobile applications, web sites, or even Arcade games • Companion games can: • Extend the story line • Give starting advantage to players • Give the players more loot or experience points. • Transfer of loot between the companion game and full game • Allow Abilities or enhanced items

  8. Why Do Them • Generate pre-launch buzz • Keep players engage over a longer period of time • The continued engagement with the brand generates: • More word of mouth recommendations • Greater revenue opportunity • Companion games have a much shorter lag between the release date of the companion game and the full game • Now for some examples…

  9. Fable II: Pub Games Step 1. Purchase pub game Step 2. Play the Gambling mini games Step 3. Profit… straight to your Fable II character.

  10. Toy Soldiers & MDTS • War Takes Money… • Contributions count toward the same war • Facebook player gets buff after playing the Xbox 360 game • Xbox 360 player gets 50% more health in Survival from Facebook

  11. Today: Crackdown’s Connections…

  12. Gameplay Specifics

  13. Companion Game Considerations… • The game lives in the cloud • Each device is a window into the same game • Simplicity • The experiences work together...period • Experience progress seamlessly across devices • Everything counts • Even if you only play for 5 minutes, it helps • Complete experience • It has to stand on its own as a fun game, it’s not just a moving ad • How do you experience the game when your companion device is next to you? • Inclusive Recruitment • Make it easy to keep selling the user on the game and tell their friends • Don’t assume simultaneous shipping of all your platforms

  14. Are Companion Games Difficult? • Cross-platform sharing is hard • Multiple authentication methods • Servers required for XLSP

  15. Solution: Xbox LIVE RESTful Services

  16. Companion Games with REST are Much Simpler! • No XLSP Servers required • Instead use simple HTTP-based RESTful services from more clients much more easily.

  17. RESTful Roadmap XBL RESTful Map Facebook Posting Social Storage Users Aggregation Avatars You are here Multiplayer Activities

  18. RESTful API Overview 2011 • Below is the list of 2011 RESTful APIs. We’ll be expanding these services over time. • Root URL is https://services.xboxlive.com /Aggregation • It’s a super scalable, near real-time, aggregated key-value store • Currently powers ESPN voting • Enables heat maps and voting scenarios in your game or video application /Activity • View Leaderboards /Matchmaking & /Multiplayer • Enables asynchronous matchmaking and multiplayer across platforms. /Storage • Title Managed Storage. More space accessible, more often /Users • Get & Set Profile information • Get & Grant achievements • Avatar Read (no writes) • Get Titles played by the user

  19. What I’m Covering in this Talk… /Users • Get & Set Profile information • Get & Grant achievements • Avatar Read (no writes) • Get Titles played by the user Other APIs will be covered in depth in other talks

  20. /Users Namespace Base URI: https://services.xboxlive.com/

  21. Reading Titles • https://services.xboxlive.com/users/xuid{xuid}/titlehistory?skipItems=1&maxItems=2 JSON: { “userTitles": [ { “currentAchievements":0, “currentGamerscore":0, “lastPlayed":"2011-06-03T15:27:00Z", “titleId":1297287259, “titleName":"Halo: Reach", “totalAchievements":59, “totalGamerscore":1400, }, { …. } ] }

  22. Reading Achievements • Read an achievement from the current user https://services.xboxlive.com/users/xuid({xuid})/progress/achievements?skipItems=1&maxItems=3 JSON: {"Achievements": [{“achievementId":28, “achievementOptions":1114112, “achievementType":1, “description":"You unlocked The Kid!", “gamerscore":10, “imageId":10, “timeAchieved":"2011-06-03T15:27:00Z", “title":"The Kid", “titleId":1480657498, “unachieved":"Find and unlock The Kid."}, … ] }

  23. Accessing RESTful Xbox LIVE Services • Console • You may call these new RESTful APIs directly • Existing APIs will continue to be supported through the XDK • Windows Phone • Existing APIs continue to be supported through XNA • You may call our new RESTful APIs • Web • Register your web site • Use our new authentication model • Use the new RESTful web services directly

  24. Authentication Model Overview Security Token Service (STS) Trust 2. Get STS Token STS Token WLID ticket Authenticate (prove your identity) Client 3. Send STS Token to access services STS Token

  25. Windows Phone Accessing New XBOX Live Services Security Token Service (STS) 0. Trust Partner Token New audience URI WLID ticket 2. Get Partner token (works like a STS token) Windows Phone Device cert 1. Call Gamer.GetPartnerTokenwith ‘New’ Audience URI Windows Phone App 3. Send STS Token with RESTful calls to access services Partner Token

  26. Considerations • We will prevent abuse of our services through TCRs. • Limits on the number of multiplayer messages sent per day • Work with your Account Manager on your capacity plan • Each platform version of a title will have its own titleid.

  27. Web Companion App Demo Web Site Demo

  28. Call to Action Get the information you need… Get tools & information @ https://developer.xboxlive.com Get started… • Talk to your Account Manager to get set up! • Start experimenting • Tell us what you would like to see… Need help? • We’re here for you… • Contact your Account Manager for assistance

  29. Questions?

More Related