Friday, January 29, 2010

Google Data And Client Libraries

Quick link for those looking to get the Google .NET API:
Working with Google's APIs to extract I've discovered some very useful links:
I've now been attempting this fun for a little while and there seems to be a fair bit of mis-direction around the Google .NET APIs. My (and others, it seems) main concern is that the .NET APIs seem to cater very well for most Google Labs/Apps uses, except for Google Analytics. Issue #1 being how to even get access/login with .NET. I have since discovered the actual Analytics .NET libraries, so the links are here. However, currently, it's important to note that the links above don't directly link to the libraries you really need.
The code I used to get an authentication token from the Google Analytics Service is:

using Google.GData.Analytics;

AnalyticsService analyticsService = new AnalyticsService(ConfigurationManager.AppSettings["ApplicationName"]);
analyticsService.setUserCredentials(ConfigurationManager.AppSettings["Email"], ConfigurationManager.AppSettings["Password"]);
string analyticsAuthToken = analyticsService.QueryClientLoginToken();
return analyticsAuthToken;

No comments:

Post a Comment