我对google healthcare API的请求在使用刷新令牌选项的OAuth 2.0playground中不起作用。我得到了“状态”:"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"
}
]
}
]}}
发布于 2019-07-13 07:49:58
您正在为Healthcare 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
https://stackoverflow.com/questions/57012303
复制相似问题