Slide 1Google DataFeedGoogle Data APIAuthenticationSlide 6Slide 7ClientLogin AuthenticationSlide 9Slide 10AuthSub AuthenticationSlide 12Slide 13Slide 14Protocol BasicsProtocol Basics…Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Common Elements: "Kinds"Slide 25Slide 26Slide 27Batch ProcessingOverviewGoogle Base Data APISlide 31Overview…Feeds UsedFeeds Used…Slide 35Google Base data APISlide 37Slide 38QueryingQuerying…YouTube Data APIVideo Feeds and EntriesUploading VideosDirect UploadingBrowser-based UploadingSearching For VideosStandard FeedsSlide 48Slide 49Slide 50SearchingUpdating a Video EntryDeleting a Video EntrySharing VideosSubscriptionsReferences1Presented By:Nageswari Vallabhaneni Sukumar Manduva2Google DataGData provides a simple standard Protocol for reading and writing data on web.Atom or RSSAtom Publishing ProtocolHTTP GET requestHTTP PUT request.Results as an Atom or RSS feed3FeedProvides frequently updated content.Syndication of a web feed allows users to subscribe to it. A web feed is also called syndicated feed.4Google Data APIAuthentication Protocol BasicsCommon Elements: "Kinds"Batch ProcessingGoogle Base APIYou Tube API5AuthenticationClient app will act on behalf of a particular user of a Google service. Access to account specific informationRequest Contains Headers for (X-GData-Key, Authorization). X-GData-Key Developer Key Authorization ClientLogin (or) AuthSub6AuthenticationClient app will act on behalf of a particular user of a Google service.GData uses two different authentication systems …1. "ClientLogin" system 2. "AuthSub" system7ClientLogin Method is used for stand alone applications.Users username, password and the application are encoded in the Authentication request.After a successful authentication request, use the Auth value to create an Authorization header for each GData request: Authorization:GoogleLoginauth=yourAuthValueClientLogin Authentication8ClientLogin Authentication9ClientLogin AuthenticationIf a ClientLogin-authenticated GData request fails, you may receive any of a variety of HTTP error status codes in response 403 Account disabled403 Account deleted401 Token disabled401 Token expired10When an API Request is made the Developer Key Header Specifies on behalf of Which registered developer the request is coming. AuthSub Authentication11AuthSub Authentication "AuthSub" system Used if your client is a multi-user web application client To acquire an AuthSub token your web app must redirect the user to the AuthSubRequest URL at Google which has “NEXT” query parameter.Gets an authentication token without ever handling the user's account login information12AuthSub AuthenticationAfter you've acquired an authentication token, you use that token to create an Authorization header for each request: Authorization: AuthSub token="yourAuthToken"13AuthSub AuthenticationIf an AuthSub-authenticated GData request fails, you may receive any of a variety of HTTP error status codes in response 401 Token invalid401 Token disabled401 Token expired401 Token revoked14AuthSub Authentication Header for 401 Token Revoked Error401 Token revoked WWW-Authenticate: AuthSub realm="http://www.google.com/accounts/AuthSubRequest" Content-Type: text/html; charset=UTF-8 Expires: Wed, 26 Mar 2008 17:11:31 GMT Cache-Control: private, max-age=0 Content-Length: 149 Date: Wed, 26 Mar 2008 17:11:31 GMT Server: GFE/1.315Protocol Basics Requesting a feed or other resource:Assume there's a feed called /Newsfeed, with no entries in it....To see it, send the following request to the server:GET /Newsfeed16Protocol Basics…The server responds:200 OK<?xml version="1.0"?><feed xmlns="http://www.w3.org/2005/Atom"> <title>e-News</title> <updated>2008-03-26T16:25:00-08:00</updated> <id>http://www.cnn.com/Newsfeed</id> <author> <name>Jo March</name> </author> <link href="/Newsfeed" rel="self"/></feed>17Protocol Basics… Inserting a new entry: POST /Newsfeed<?xml version="1.0"?><entry xmlns="http://www.w3.org/2005/Atom"> <author> <name>Paul Harvey</name> <email>[email protected]</email> </author> <title type="text">HeadLines</title> <content type="text">VT Beat UVa</content></entry>18Protocol Basics…The server responds:201 CREATED<?xml version="1.0"?><entry xmlns="http://www.w3.org/2005/Atom"> <id>1</id> <link rel="edit" href="http://cnn.com/Newsfeed/1/1/"/> <updated>2008-03-26T16:26:03-08:00</updated> <author> <name>Paul Harvey</name> <email>[email protected]</email> </author> <title type="text">HeadLines</title> <content type="text">VT Beat UVa</content></entry>19Protocol Basics…Updating an entry :To update an existing entry, use PUT, with the entry's edit URI Changing entry's text from (" VT Beat UVa ") to (“VT embarrassed UVa."):PUT /myFeed/1/1/<?xml version="1.0"?><entry xmlns="http://www.w3.org/2005/Atom"> <id>1</id> <link rel="edit" href="http://cnn.com/Newsfeed/1/1/"/> <updated>2008-03-26T16:28:05-08:00</updated> <author> <name>Paul Harvey</name> <email>[email protected]</email> </author> <title type="text"> Head Lines </title> <content type="text"> VT embarrassed UVa.</content></entry>20Protocol Basics…The server responds:200 OK<?xml version="1.0"?><entry xmlns="http://www.w3.org/2005/Atom"> <id>1</id> <link rel="edit" href="http://cnn.com/Newsfeed/1/2/"/> <updated>2008-03-26T16:28:05-08:00</updated> <author> <name>Paul Harvey</name> <email>[email protected]</email> </author> <title type="text"> Head Lines </title> <content type="text"> VT embarrassed UVa.</content></entry>Edit URI has changed..It now ends with "/2/" instead of "/1/". The final number in the edit URI is a version number.21Protocol Basics…Searching for a string:To do a full-text search for a particular string , send a GET request with the q parameter.GET /Newsfeed?q=VT22Protocol Basics…The server responds with all the entries that match the search string “VT”200 OK<?xml version="1.0"?><feed xmlns="http://www.w3.org/2005/Atom"> <title>e-News</title> <updated>2008-03-26T16:26:03-08:00</updated> <id>http://www.cnn.com/Newsfeed</id> <author> <name>Jo March</name> </author> <link href="/Newsfeed" rel="self"/> <entry> <id>1</id> <link rel="edit" href="http:// www.cnn.com/Newsfeed
View Full Document