javascript - gapi.client.plus.people.get 返回 403 错误

标签 javascript google-app-engine

我正在开发一个网页的应用程序引擎项目。 我在开发者控制台中打开了 Google+ API。 网页登录为:

userService.createLoginURL(request.getRequestURI())

之后我想检索已登录用户的个人资料图片。 为此,我导入了 js 库:

<script src = "https://plus.google.com/js/client:platform.js" async defer></script>

和:

<script src="https://apis.google.com/js/client:plusone.js" type="text/javascript"></script>

然后我执行:

gapi.client.load('plus','v1', function(){
    var request = gapi.client.plus.people.get({
        'userId': 'me'
    });
    request.execute(function(resp) {
        console.log('Image at:' + resp.image.url);
    });
});

但是这会继续返回 403 错误:

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "dailyLimitExceededUnreg",
    "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
    "extendedHelp": "https://code.google.com/apis/console"
   }
  ],
  "code": 403,
  "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
 }
}

我该如何解决这个问题?我错过了什么?

最佳答案

我无法发表评论,所以我正在为其写一个答案。

转到 Google 开发者控制台:

  • 选择您的项目。
  • 转到左侧面板上的 API 和身份验证。
  • 选择您正在使用的 API。
  • 点击使用情况选项卡并查看您发出的请求数量。

请求数必须超过您尝试使用的 API 的每日免费限制。

关于javascript - gapi.client.plus.people.get 返回 403 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30798197/

相关文章:

python - Google ML 引擎和 Python 数据存储 API, 'Forbidden: 403 Request had insufficient authentication scopes.'

javascript - 在javascript中释放数组数组的最佳方法

javascript - Fabric.js 对象大小

javascript - Django 表单上的 jQuery 验证插件

javascript - A帧图像亮度

javascript - Google+ Oauth 2.0 - 注销效果很好,但刷新网页后自动登录

javascript - 沃罗诺伊 map : Unable to find data that I just associated with an object

google-app-engine - 启动和停止 Google App Engine 后端

python - 处理带有排队任务的列表。如何确保列表中的每个值仅使用一次?

django - 如何在 Django 中使用缓存? (最好在GAE中)