【发布时间】:2015-08-20 12:20:19
【问题描述】:
在向 GA 发送请求之前,我使用以下 google analyics api 代码进行身份验证,但我收到错误消息
"解析值时遇到意外字符:<.path ga api>
同时通过
GAOuthService.Data.Ga.Get()方法
我的验证码:
var scopes = new[] { AnalyticsService.Scope.Analytics,
AnalyticsService.Scope.AnalyticsEdit,
AnalyticsService.Scope.AnalyticsManageUsers,
AnalyticsService.Scope.AnalyticsReadonly};
// here is where we Request the user to give us access, or use the Refresh Token that was previously stored in %AppData%
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = clientId, ClientSecret = clientSecret }
, scopes
, userName
, CancellationToken.None
, new FileDataStore("GoogleAnalytics.Auth.Store")).Result;
var service = new AnalyticsService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "xyz",
});
【问题讨论】:
-
您忘记发布您用于 GAOuthService.Data.Ga.Get() 的代码 身份验证不会给您一个错误,因为发布代码将无济于事。
标签: c# google-api google-oauth google-analytics-api google-api-dotnet-client