403 错误消息:未配置访问.请使用 Google Developers Console 为您的项目激活 API
无法克服这种情况:在 Google 开发者控制台中创建了一个项目他们创建了Web 应用程序的客户端 ID"和服务器应用程序的密钥".
Can't overcome this situation: created a project in the Google developers console they created "Client ID for web application" and "Key for server applications".
在控制台请求已成功完成,但是当我从服务器发送时出现以下错误:
In the console requests have completed successfully, but when I send from the server I get the following error:
403: {
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
构造查询的参数检查..请求继续:
Parameters to construct the query checked.. the request goes on:
"https://www.googleapis.com/calendar/v3/freeBusy?key=my_key"
pass parameters: "{"items":[{"id":"calendar_id@group.calendar.google.com"}],"timeMax":"2014-04-09T00:00:00+01:00","timeMin":"2014-01-09T00:00:00+01:00","timeZone":"Europe/Berlin"}"
我在哪里可以看到错误是什么?
Where can I see what the error is?
是否在此帮助 Billing(目前已关闭Billing is not enabled")?
Whether in this help Billing (at the moment it is turned off "Billing is not enabled")?
==========================更新:问题是这样解决的(如萨满教):我刚刚在google api中创建了一个新项目,下一个选项卡APIs&auth->Credentials"我添加到项目Web 应用程序的客户端 ID"中,当您创建时立即指出重定向 URI",当您创建时会自动生成浏览器应用程序的密钥",可以与任何主机一起使用).完成这些步骤后,我指向一个网站创建的设置和请求.
========================== UPDATED: The problem was resolved so (like shamanism): I just created a new project in the google api, next tab "APIs&auth->Credentials" I added to the project "Client ID for web application", when you create immediately pointed out "Redirect URIs" when you create is automatically generated "Key for browser applications"that can work with any host). After these steps, I point to a website created settings and requests are.
发送使用 drupal 和模块的请求:gauth 和 gcal(使用 http://code.google.com/p/google-api-php-client/).
To send requests to use drupal and modules: gauth and gcal (which uses http://code.google.com/p/google-api-php-client/).
推荐答案
我遇到了完全相同的错误(除了 Google Glass Mirror API).添加帐单信息并将 http/https 添加到我的重定向 URL 也无济于事.
I was getting the exact same error (except with the Google Glass Mirror API). Adding billing information and adding both http/https to my redirect URL didn't help either.
当您同时提供 OAuth2 凭据和 API 密钥时,显然 Google API 会出现行为不端!解决方案(如果您使用的是适用于 PHP 的 Google API 客户端库)是简单地从您的代码中删除以下内容:
Apparently Google APIs have been known to misbehave when you provide both OAuth2 credentials and an API Key! The solution (if you are using the Google APIs Client Library for PHP) is to simply remove the following from your code:
$client->setDeveloperKey($key);
希望这会有所帮助.
相关文章