【问题标题】:Error while calling google+ method plusService.People.Get调用 google+ 方法 plusService.People.Get 时出错
【发布时间】:2014-04-02 19:54:29
【问题描述】:

Google+ API 在 Google 的开发者控制台中设置为“开启”。我通过提供 api 密钥来获取用户的个人资料信息,但我收到一条错误消息:

访问未配置。请使用 Google Developers Console 为您的项目激活 API。 [403]

  BaseClientService.Initializer ini = new BaseClientService.Initializer { ApiKey = "" };
  PlusService plusService = new PlusService(ini);
  if (plusService != null)
  {
         PeopleResource.GetRequest prgr = plusService.People.Get("me");
         Person googleUser = prgr.Execute();
  }

调用Execute时抛出错误。

是否需要使用“计费”配置文件设置此服务?这可能是我收到访问错误的原因。

【问题讨论】:

    标签: google-api google-plus


    【解决方案1】:

    “me”参数仅在您拥有经过身份验证的用户的 OAuth 2.0 访问令牌时才有效。使用密钥的简单 API 访问仅允许访问公共数据 - 尝试输入数字用户 ID 而不是我,您应该会得到响应。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-31
      • 1970-01-01
      • 2015-01-30
      • 2012-05-09
      相关资源
      最近更新 更多