Google Glass开发错误:(403)访问未配置。请使用Google Developers Console为您的项目激活API [英] Google Glass Development Error: (403) Access Not Configured. Please use Google Developers Console to activate the API for your project

查看:254
本文介绍了Google Glass开发错误:(403)访问未配置。请使用Google Developers Console为您的项目激活API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google Glass Developer Kit的PHP版本。根据示例代码说明安装一切。 API /凭证都很好,帐户结算已设置,已将Mirror API添加到项目中,但在我申请权限后,出现以下错误:

 发生错误:错误调用POST 
https://www.googleapis.com/mirror/v1/timeline?key=xxxxxx
(403)访问未配置。
请使用Google Developers Console为您的项目激活API。

我已经添加了Mirror API,并且Billing处于活动状态,因此不知道为什么我得到错误信息。

解决方案

当您提供OAuth2凭证和提供OAuth2凭证时,Google API已知行为不当一个API密钥。此外,由于您必须使用OAuth2才能访问Mirror API,因此无论如何 key = xxxxx 都是不必要的。

如果您使用PHP的Google API客户端库,则可以简单地从代码中删除以下行:

  $ client- > setDeveloperKey($键); 

不完全确定这是否会导致您的问题,但我在其他Google API中遇到类似问题。

I am using the PHP version of the Google Glass Developer Kit. Setup everything per the sample code instructions. API/credentials are all fine, account billing is setup, have added the Mirror API to the project, but after I permission the application, I get the following Error:

An error ocurred: Error calling POST 
https://www.googleapis.com/mirror/v1/timeline?key=xxxxxx 
(403) Access Not Configured. 
Please use Google Developers Console to activate the API for your project.

I have added the Mirror API and have Billing active and setup so have no idea why i am getting the error message. Testing the app via the Glass Explorer works just fine.

解决方案

Google APIs have been known to misbehave when you provide both OAuth2 credentials and an API Key. Also since you have to use OAuth2 to access the Mirror API, the key=xxxxx isn't necessary anyway.

If you are using the Google APIs Client Library for PHP you can simply remove the following line from your code:

 $client->setDeveloperKey($key);

Not entirely sure if this causes your issue, but I have come across similar issues in other Google APIs.

这篇关于Google Glass开发错误:(403)访问未配置。请使用Google Developers Console为您的项目激活API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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