Youtube API 权限 403 禁止错误 [英] Youtube API permission 403 Forbidden error

查看:24
本文介绍了Youtube API 权限 403 禁止错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm following the tutorial on this page but I keep getting a 403 Forbidden error when I run the app and try to do a search.

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

I enabled Youtube Data API v3 on the https://console.developers.google.com/ page and I created an 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 键解决了这个问题.浏览器键不需要有任何条目,以便它会说允许所有引用"

I have resolved the problem by creating a Browser key instead of an android key. The browser key needs to have no entry so that it'll say "all refered allowed"

这篇关于Youtube API 权限 403 禁止错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆