从 OAuth-2.0 playground 访问 Google Healthcare API 时权限被拒绝

Permission denied while accessing Google Healthcare API from OAuth-2.0 playground

我对 google 医疗保健 API 的请求无法使用刷新令牌选项从 OAuth 2.0 游乐场运行。我得到 "status":"PERMISSION_DENIED"。请求的 API 已启用多日。这是请求和响应的详细信息。

    POST 
    /v1alpha2/projects/<project_id>/locations/<location>/datasets? 
    datasetId=<dataset_id> HTTP/1.1
    Host: healthcare.googleapis.com
    Content-length: 0
    Content-type: application/json
    Authorization: Bearer 
    HTTP/1.1 403 Forbidden
    Content-length: 767
    X-xss-protection: 0
    X-content-type-options: nosniff
    Transfer-encoding: chunked
    Vary: Origin, X-Origin, Referer
    Server: ESF
    -content-encoding: gzip
    Cache-control: private
    Date: Fri, 12 Jul 2019 17:57:39 GMT
    X-frame-options: SAMEORIGIN
    Alt-svc: quic=":443"; ma=2592000; v="46,43,39"
    Content-type: application/json; charset=UTF-8
    {
    "error": {
"status": "PERMISSION_DENIED", 
"message": "Cloud Healthcare API has not been used in project <project_id> before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/healthcare.googleapis.com/overview?project=<project_ud> then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", 
"code": 403, 
"details": [
  {
    "@type": "type.googleapis.com/google.rpc.Help", 
    "links": [
      {
        "url": "https://console.developers.google.com/apis/api/healthcare.googleapis.com/overview?project=<project_id>", 
        "description": "Google developers console API activation"
      }
    ]
  }
]

} }

您正在使用 Healthcare API 的 Alpha 端点,该端点已被 Google 停用。您可以在此处查看如何为 Beta API 进行转换:https://cloud.google.com/healthcare/docs/how-tos/transition-guide.

另请注意,除了请求中的更改 URL

/v1beta1/projects/<project_id>/locations/<location>/datasets

现在的响应是 long-running 操作: https://cloud.google.com/healthcare/docs/reference/rest/v1beta1/projects.locations.datasets.operations