【问题标题】:Please ensure that the client is sending referer or use the API Console to remove the referrer restrictions.Google Calendar API请确保客户端正在发送引荐来源网址或使用 API 控制台删除引荐来源网址限制。Google Calendar API
【发布时间】:2017-10-31 18:45:47
【问题描述】:

我必须尝试通过 javascript 获取 google calander 事件。

在 Google 控制台中,我创建了一个项目、API 密钥、OAuth 客户端 ID 并为 Google 日历启用 API。

我已将 Authorized javascript origin 设置为 http://localhost

gapi.auth.authorize({ client_id: clientId, scope: scopes, immediate: false }, handleAuthResult);

在工作正常前两天,但昨天它没有工作并出现以下错误。

请求未指定任何引用者。请确保客户 正在发送引荐来源网址或使用 API 控制台删除引荐来源网址 限制。

错误信息是

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "ipRefererBlocked",
    "message": "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions.",
    "extendedHelp": "https://console.developers.google.com/apis/credentials?project=698394884872"
   }
  ],
  "code": 403,
  "message": "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions."
 }
}

【问题讨论】:

标签: javascript google-api google-calendar-api


【解决方案1】:

我在通过邮递员访问 YouTube API 时遇到了同样的问题。

网址 -

 https://content.googleapis.com/youtube/v3/videos?id=H61xC_BUros&part=snippet%2CcontentDetails%2Cstatistics&key=

面临错误 -

{
    "error": {
        "errors": [
            {
                "domain": "usageLimits",
                "reason": "ipRefererBlocked",
                "message": "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions.",
                "extendedHelp": "https://console.developers.google.com/apis/credentials?project=292824132082"
            }
        ],
        "code": 403,
        "message": "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referrer restrictions."
    }
}

工作解决方案 -

添加以下(通过邮递员时在标题中)

Referer : https://explorer.apis.google.com 

【讨论】:

    猜你喜欢
    • 2017-12-20
    • 1970-01-01
    • 2017-06-18
    • 2016-10-19
    • 1970-01-01
    • 1970-01-01
    • 2015-12-12
    • 2012-08-14
    相关资源
    最近更新 更多