【问题标题】:Google APIs Get User Email PHPGoogle API 获取用户电子邮件 PHP
【发布时间】:2020-06-07 23:49:01
【问题描述】:

我在我的网站中使用 Google plus API 来登录用户并且效果很好,但是因为我只需要用户电子邮件,因为我创建了自己的 Auth Token 我不再需要使用 Google plus API,因为 Gmail API 提供我需要的所有信息还提供更多 daily query 1,000,000,000 与 Google plus API 的 20,000,000 相比。

问题是:

当我使用 Gmail API 时,我得到的信息与 Google plus API 提供的信息相同,这很棒。

但是,转到Google Cloud Console >> OAuth consent screen Tap >> OAuth rate limits 中的我的仪表板。

上面写着Your token grant rate = Your current per day token grant rate limit is 10,000 grants per day. The per day token grant rate resets every day

那么,我错过了什么吗?

注意:当我切换到 Gmail API 时,我确实更改了 client keysecret keyGoogle Sign In URL

【问题讨论】:

    标签: php google-api gmail-api


    【解决方案1】:

    OAuth Rate LimitsGmail API Usage Limits 之间存在差异。在设计您的应用时,您需要考虑以下两个因素:

    1) OAuth

    OAuth Rate Limits 是指您的应用程序可以向 Google 请求的令牌数量,以便能够从使用您的应用程序的用户那里获得敏感范围的权限,并以这种方式允许访问他们的数据(如何调用 Google 的 API 时,很多数据取决于范围。

    2) Gmail API

    Gmail API Usage Limits 是指您的应用可以对 API 执行的请求数量,无论用户数量(只要不超过限制),因为它之前已通过 OAuth 速率限制检查.

    【讨论】:

    • 谢谢,这是我第一次使用 Google API,这有点令人困惑,不过最后一件事,你引用了Gmail API Usage Limits,我找不到是否有 Google plus API 使用限制,你有那个链接吗?
    • 不客气!不再支持 Google Plus API,因此我建议您继续使用 Gmail API。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-22
    • 1970-01-01
    • 2017-05-22
    • 1970-01-01
    • 2017-10-20
    • 2014-05-05
    相关资源
    最近更新 更多