[英]How to get Google account data (project, place and all place reviews) using OAuth2 Playground while PERMISSION DENIED error
The case:案子:
I want to get all Google My Business API place reviews using OAuth2 for internal project.我想为内部项目使用 OAuth2 获取所有 Google 我的商家 API 地方评论。 I am using OAuth2 Playground for testing purposes while I am not able to get proper permission in these steps:
我正在使用 OAuth2 Playground 进行测试,但我无法在这些步骤中获得适当的许可:
Even in my project I was able to implement this: https://developers.google.com/my-business/content/implement-oauth .即使在我的项目中,我也能够实现这个: https://developers.google.com/my-business/content/implement-oauth 。 While I was able to use in OAuth2 Playground this: https://developers.google.com/my-business/content/account-data .
虽然我能够在 OAuth2 Playground 中使用这个: https://developers.google.com/my-business/content/account-data 。 But I need to use this: https://developers.google.com/my-business/content/review-data .
但我需要使用这个: https://developers.google.com/my-business/content/review-data 。
The error message in response:响应中的错误消息:
{
"error": {
"status": "PERMISSION_DENIED",
"message": "Google My Business API has not been used in project PROJECTCODE before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/mybusiness.googleapis.com/overview?project=PROJECTCODE 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/mybusiness.googleapis.com/overview?project=PROJECTCODE",
"description": "Google developers console API activation"
}
]
},
{
"reason": "SERVICE_DISABLED",
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"domain": "googleapis.com",
"metadata": {
"consumer": "projects/PROJECTCODE",
"service": "mybusiness.googleapis.com"
}
}
]
}
}
After I access the project info from the link from response It will show error:"You do not have sufficient permissions to view this page" and this:在我从响应的链接访问项目信息后,它将显示错误:“您没有足够的权限查看此页面”和这个:
You are missing the following required permissions: Project resourcemanager.projects.get serviceusage.services.get您缺少以下必需权限:项目 resourcemanager.projects.get serviceusage.services.get
and links to the IAM docs which I find very confusing.以及我觉得非常混乱的 IAM 文档的链接。
Questions:问题:
Please check if you have access to the Google My Business API by visiting https://console.cloud.google.com/apis/dashboard请通过访问https://console.cloud.google.com/apis/dashboard 检查您是否有权访问 Google 我的商家 API
Unlike the My Business Account Management API, the Google My Business API required to retrieve reviews is private.与我的企业帐户管理 API 不同,检索评论所需的 Google 我的企业 API 是私有的。
Edit : the overview page is not the issue, I am talking about API access.编辑:概览页面不是问题,我说的是 API 访问。 It should show up in the list of enabled APIs:
它应该出现在已启用的 API 列表中:
Edit 2 : You are missing the 9th API, the original Google My Business API. Since the documentation ( https://developers.google.com/my-business/content/prereqs#request-access ) does not mention how to get access to the old API, I would try contacting the API support if they still give out access to it: https://support.google.com/business/contact/api_default编辑 2 :您缺少第 9 个 API,原始的 Google 我的商家 API。由于文档( https://developers.google.com/my-business/content/prereqs#request-access )没有提及如何获得访问权限对于旧的 API,如果他们仍然允许访问它,我会尝试联系 API 支持: https://support.google.com/business/contact/api_default
in the message you received there is a link in url object在您收到的消息中有一个链接 url object
"links": [ { "url": "https://console.developers.google.com/apis/api/mybusiness.googleapis.com/overview?project=PROJECTCODE", "description": "Google developers console API activation" }
"links": [ { "url": "https://console.developers.google.com/apis/api/mybusiness.googleapis.com/overview?project=PROJECTCODE", "description": "谷歌开发者控制台API激活“}
copy that link, open it in the browser, and probably you need to sign into you account and then Enable
the APi. Then you should be able to run your code or see what you want in playground复制该链接,在浏览器中打开它,您可能需要登录您的帐户,然后
Enable
APi。然后您应该能够运行您的代码或在 playground 中查看您想要的内容
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.