无效的开发者密钥 [英] Invalid Developer Key

查看:45
本文介绍了无效的开发者密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在构建应用程序时达到了 youtube api 配额限制,因此我向请求添加了开发人员密钥,现在我收到 403 错误:无效的开发人员密钥.

I was reaching the youtube api quota limit while building my application so I added a developer key to the request and now I get a 403 error: Invalid Developer Key.

我多次尝试重新创建我的项目和 api 密钥,但没有任何运气.我已经尝试将密钥添加到 URI 并在标题中发送它:

I've tried recreating my project and api key multiple times without any luck. I've tried adding the key to the URI as well as sending it in a header:

$c1 = curl_init($feedURL);
curl_setopt($c1, CURLOPT_HTTPHEADER, array(
   'X-GData-Key: key=AIzaS...',
   'GData-Version: 2'
));

我的应用程序很简单,所有请求的数据都是公开的,所以我看不到使用 Zend PHP 客户端的理由.

My application is simple, all requested data is public, so I don't see a reason to use the Zend PHP Client.

推荐答案

您在查询 API 的 v2 时使用了 v3API 密钥".

You're using a v3 "API key" while querying v2 of the API.

v3API 密钥"从 https://code.google 的访问选项卡中获取.com/apis/console/ 并且是您用来向该控制台上列出的任何 API 发出未经身份验证的请求的工具.

v3 "API key"s are obtained from the Access tab of https://code.google.com/apis/console/ and are what you use to make non-authenticated requests to any of the APIs listed on that console.

v2开发者密钥"从 http://code.google.com/获得apis/youtube/dashboard/ 就是您要查找的内容.

v2 "developer key"s are obtained from http://code.google.com/apis/youtube/dashboard/ and is what you're looking for.

我相信其中一个目标是改造 API 的 v2 以开始支持来自 API 控制台的API 密钥",但这在目前是不可能的.

I believe that one of the goals is to retrofit v2 of the API to start supporting "API key"s from the API console, but that isn't something that's possible at this time.

这篇关于无效的开发者密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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