我必须通过javascript尝试获取google calander事件。
在Google控制台中,我创建了一个项目,API密钥,OAuth客户端ID并为Google日历启用了API。
我已将授权的javascript来源设为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."
}
}
答案 0 :(得分:2)
通过邮递员访问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