0

I want to create an AnalyticsRequest object using oauth. Everything is working accept the callback page. With the client lib for youtube my code looks like this;

                settings = new YouTubeRequestSettings(appName, clientID, developerKey(string)Session["token"]);
            YouTubeRequest request = new YouTubeRequest(settings);

and for analytics

gt.request = new AnalyticsRequest(new RequestSettings());

but I cant seem to find the right overload of the constructor of RequestSettings.

thommie
  • 438
  • 5
  • 22

2 Answers2

0

Look at the svn of google-gdata .Net library, there is a full example with AnalyticsRequest.

Yohann
  • 6,047
  • 3
  • 26
  • 33
0

The library includes an OAuth 2.0 sample that uses both a service class (GroupsService) and a request class (ContactsRequest) and should be easy to adapt to use the Analytics API:

http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/oauth2_sample/oauth2demo.cs

I'm not an expert on the Analytics API but I understand it supports OAuth 2.0 as it is also listed in the OAuth 2.0 Playground:

https://code.google.com/oauthplayground/

Claudio Cherubino
  • 14,896
  • 1
  • 35
  • 42