小编Pat*_*tel的帖子

请求的身份验证凭据无效.云语音API中预期的OAuth 2访问令牌错误

我已经按照谷歌云语音api快速启动请求api使用

curl -s -H "Content-Type: application/json" \
     -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
     https://speech.googleapis.com/v1/speech:recognize \
     -d @sync-request.json
Run Code Online (Sandbox Code Playgroud)

和以下链接,但我有错误

{
  "error": {
    "code": 401,
    "message": "Request had invalid authentication credentials. 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"
  }
}
Run Code Online (Sandbox Code Playgroud)

我现在应该怎么做?

Thanx提前

api oauth google-cloud-platform google-speech-api

15
推荐指数
4
解决办法
2万
查看次数