1

我对谷歌医疗 API 的请求在 OAuth 2.0 操场上使用刷新令牌选项不起作用。我得到“状态”:“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"
      }
    ]
  }
]

} }

4

1 回答 1

0

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

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

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

现在的响应是一项长期运行的操作: https ://cloud.google.com/healthcare/docs/reference/rest/v1beta1/projects.locations.datasets.operations

于 2019-07-12T23:49:57.860 回答