android - Youtube API 权限 403 禁止错误

标签 android json youtube youtube-api

我正在学习 this 上的教程页面,但当我运行应用程序并尝试进行搜索时,我不断收到 403 Forbidden 错误。

我在 https://console.developers.google.com/ 上启用了 Youtube Data API v3页面,我创建了一个 Android API key 。

有什么建议吗?谢谢。

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."
}

最佳答案

我通过创建浏览器键而不是安卓键解决了这个问题。浏览器键需要没有条目,以便它会说“所有引用都允许”

关于android - Youtube API 权限 403 禁止错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28591012/

相关文章:

api - 使用JAVA代码的JSON格式的ResultSet

html - 在HTML中包含YouTube视频播放器

python - 合并两个 YouTube API 脚本

java - getLocalSocketAddress() 和 getRemoteSocketAddress() 未返回正确的值

安卓:自动刷新谷歌地图

javascript - 数据以 JSON 对象的形式传入,如何解析?

javascript - 如何发布 json?

android - 在安卓应用中等待

android - xmlns : android parsing

java - 如何通过 ListView 传递数据,Android - Java