lli-klick / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

Login Required Error #450

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using Google.Apis.Analytics.v3 to get Google analytics data, here is my 
code: 

AnalyticsService service = new AnalyticsService(new 
Google.Apis.Services.BaseClientService.Initializer() { ApiKey = 
"AIzaSyAZhndUDqkRkYt9hEd-FEIdYFm10kTzcKQ", ApplicationName  = "My App",  });

string profileID = "ga:82195113";            
string metrics = "ga:visit";
string startDate = "2014-01-14";
string endDate = "2014-02-14";

DataResource.GaResource.GetRequest request = service.Data.Ga.Get(profileID, 
startDate, endDate, metrics);
GaData data = request.Execute();

when call request.Execute(), the "Login Required" exception throw, but i don't 
know how to set credential of the service, please help me!

Original issue reported on code.google.com by NGUYENMINHTIEN1411 on 14 Feb 2014 at 10:00

GoogleCodeExporter commented 9 years ago
Take a look in our OAuth 2.0 page - 
https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth

I'm closing this issue, feel free to reopen if you need any additional help.

Original comment by pele...@google.com on 16 Feb 2014 at 4:47

GoogleCodeExporter commented 9 years ago
It works, thanks for your help!

Original comment by NGUYENMINHTIEN1411 on 18 Feb 2014 at 7:58