我正在尝试构建一个 SMS(文本消息)应用程序,它使用 Google Translate API 来翻译发送给它的文本。我已经设置了 App Engine 和整个 8000 步过程,选择公共 API 密钥访问,而不是选择 oauth,在意识到如果不给 Google 信用卡号码就不会让我手动设置配额限制,然后设置计费,最后进入“编辑允许的引用者”,我将其设置为:
*
...在调试时,我打算将其更改为代码所在位置的实际 URL。
使用星号不起作用。我必须使用 Google Translate API v2 Public API referrer 规则的语法来允许来自网络空间中任何地方的连接,比如 Apigee?目前这个调用(用 MY_KEY_HERE 代替了实际的键):
https://www.googleapis.com/language/translate/v2?key=MY_KEY_HERE&q=hello%20world&source=en&target=de
回报:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration.",
"extendedHelp": "https://console.developers.google.com"
}
],
"code": 403,
"message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration."
}
}