YouTube 数据 API v3、Web 应用程序、403 使用限制 accessNotConfigured [英] YouTube Data API v3, Web Application, 403 usageLimits accessNotConfigured

查看:22
本文介绍了YouTube 数据 API v3、Web 应用程序、403 使用限制 accessNotConfigured的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试访问 YouTube Data API v3 时遇到问题.这是我每次发送有效请求时得到的 json 响应:

I'm having trouble when trying to access the YouTube Data API v3. This is the json response I get whenever I send a valid request:

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured"
   }
  ],
  "code": 403,
  "message": "Access Not Configured"
 }
}

我的有效请求之一的示例:

Example of one of my valid requests:

https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=5&q=funny&key=*my_valid_api_browser_key*

这是我在 Google API 控制台中设置的服务的屏幕截图:

Here is a screenshot of my services setting in the Google APIs Console:

http://imgur.com/GA747

此外,我已经注册了该应用程序,它有一个项目 ID 和客户 ID.我还尝试将上面示例中的 api_key 参数(我的有效请求 URL 之一)与有效的 api server 密钥交换(我相信这仅在请求来自关联的 IP 地址时才有效)使用密钥,我可以这样做,因为我可以从正确的服务器发出 API 请求);但是,我仍然得到完全相同的结果.

In addition, I have registered the application and it has a Project ID and Client ID. I have also tried swapping the api_key parameter in the example above, one of my valid request URLs, with a valid api server key (and I believe this will only work if the request comes from the IP address associated with the key, which I can do because I can make the API request from the correct server); however, I still get the exact same result.

YouTube 数据 API v3 是否公开?它似乎是在 2012 年 12 月 12 日公开发布的,当时发布了 YouTube Data API v3 的此视频:http://www.youtube.com/watch?v=tlcWiP7OLFI.不过我想我可能是错的.

Is the YouTube Data API v3 public yet? It appears that it was released publicly on December 12, 2012 when this video for the YouTube Data API v3 was released: http://www.youtube.com/watch?v=tlcWiP7OLFI. I guess I could be wrong though.

关于为什么我会收到此特定响应而不是具有与我的查询匹配的预期视频列表的响应的任何其他想法?

Any other ideas on why I could be getting this particular response instead of a response that has the expected list of videos matching my query?

推荐答案

Jeff,您的电子邮件推荐解决了我的问题.我从 Referers 字段中删除了所有行.现在,在我的 Google API 控制台中,在该项目的 API 访问屏幕上,标题为浏览器应用程序的密钥(带引用者)"的部分下有一个引用者"字段,内容为 --> 引用者:允许任何引用者.

Jeff, your email recommendation resolved my issue. I removed all lines from the Referers field. Now, in my Google API console, on the API Access screen for this project, under the section titled 'Key for browser apps (with referers)' has a 'Referers' field that reads --> Referers: Any referer allowed.

现在,我从 API 获得了准确的 JSON 响应.

Now, I get an accurate JSON response from the API.

这篇关于YouTube 数据 API v3、Web 应用程序、403 使用限制 accessNotConfigured的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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