【问题标题】:Response from using a brand new Google API Server Key says 'The provided API key is expired'使用全新的 Google API 服务器密钥的响应显示“提供的 API 密钥已过期”
【发布时间】:2014-07-19 13:11:18
【问题描述】:

我最近创建了一个 Google 开发者帐户,附加了用于结算的信用卡信息,启用了 Places API,并创建了一个服务器密钥并附加了我的服务器 IP 地址 - 但是当我尝试在我的代码中访问 API 时,我得到了回应:

SimpleXMLElement Object
(
    [status] => REQUEST_DENIED
    [error_message] => The provided API key is expired.
)

我用于 API 访问的端点是:https://maps.googleapis.com/maps/api/place/textsearch/xml?query=$query&type=$type&sensor=true&key=$serverkey

那个 error_message 可能是另一个问题的征兆吗?也许我使用了错误的端点,或者错误类型的 API 密钥?一个全新的服务器密钥会过期似乎很奇怪......

【问题讨论】:

标签: php api google-maps


【解决方案1】:

听起来您可能需要浏览器密钥,而不是服务器密钥。

【讨论】:

    猜你喜欢
    • 2020-07-08
    • 1970-01-01
    • 1970-01-01
    • 2020-10-22
    • 2015-01-03
    • 2015-12-09
    • 2013-07-16
    • 1970-01-01
    • 2017-04-19
    相关资源
    最近更新 更多