【问题标题】:Used Google Cloud Translation API When return response 403 "Daily Limit Exceeded"返回响应 403“超出每日限制”时使用 Google Cloud Translation API
【发布时间】:2017-08-01 04:48:43
【问题描述】:

以下确认已完成。

  • 信用卡已注册
  • 不超过API各阈值的上限

所以,我能够正常运行到昨天。 但是今天我会一直报错。

我使用“云翻译 API 客户端库”, 如果还有其他需要检查的地方,请教教我好吗?

$translate = new TranslateClient([
    'projectId' => 'xxxxxxx',
]);
$result = $translate->translate('I am playing Dragon Quest 11 ', [
    'source' => 'en',
    'target' => 'ja',
]);

【问题讨论】:

    标签: php language-translation gcp


    【解决方案1】:

    自己解决了。

    用于授权类型'authorized_user'。

    认证方式不匹配。

    我的解决办法是:

    构造函数添加选项'keyFilePath'目录。

    $translate = new TranslateClient([
        'projectId' => 'xxxxxxx',
        'keyFilePath' => env('GOOGLE_APPLICATION_CREDENTIALS')
    ]);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-12
      • 1970-01-01
      • 2020-10-11
      • 1970-01-01
      • 1970-01-01
      • 2017-12-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多