【发布时间】:2014-08-13 08:20:54
【问题描述】:
我正在尝试访问数据 api 以便根据关键字搜索视频,
SearchListResponse list=search.execute();
但我得到了这个例外:
403 Forbidden
{
"code": 403,
"errors": [
{
"domain": "usageLimits",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project.",
"reason": "accessNotConfigured"
}
],
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
但是我已经在 api 控制台中激活了 yputube 数据 api,并且我已经生成了一个我正在使用的 api 密钥
search.setKey("MY_KEY");
注意:我已经在控制台中为我的项目启用了 youtube data api,并且 m 使用公共 api 密钥来访问它
【问题讨论】:
-
您是否为 android 配置了 api,是否输入了密钥库 SHA1 证书指纹和包名称(用分号分隔),并检查您的 youtube 频道在浏览器中是否正常工作(我的频道问题很少几周前得到了同样的错误)
-
是的,我这样做了,我已经解决了这个问题。我不得不使用浏览器 api 密钥来执行()方法。由于此方法是 java 客户端 api 的一部分,而不是 android 客户端 api
标签: android youtube youtube-data-api