谷歌翻译API授权问题

时间:2020-04-01 06:31:52

标签: authentication google-cloud-translate

我正在尝试使用带有REST api https://translation.googleapis.com/v3的GCP翻译服务来翻译一些文本 我正在使用API​​密钥身份验证方法。

url和 身体

https://translation.googleapis.com/v3/projects/my-translator-1122333:translateText?key=thisismykey
{
    "content": ["Hello"],
    "sourceLanguageCode": "en",
    "targetLanguageCode": "ru"
}

但是我得到了

{
  "error": {
    "code": 401,
    "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "status": "UNAUTHENTICATED"
  }
}

有人可以解释我做错了什么吗? 谢谢

0 个答案:

没有答案