我一直在遵循本教程创建Youtube应用程序。。我创建了Browser-Android API密钥,并在我的项目中尝试了这两种方法。。但当我尝试运行它并搜索时,我得到了:
Could not search: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "usageLimits",
"message" : "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.",
"reason" : "ipRefererBlocked",
"extendedHelp" : "https://console.developers.google.com"
} ],
"message" : "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed."
}
有什么想法吗。。?
您所要做的就是:从"浏览器应用程序的密钥"。
通过将浏览器api的referer设置为任何允许的referer来修复问题。
将其设置为"允许任何引用"就像擦除所有允许引用的输入一样简单。