标签: google-my-business-api

要从google places API获得超过5条评论

我正在做一个应用程序,我使用google places API提取谷歌评论.当我在" https://developers.google.com/maps/documentation/javascript/places "中阅读与其相关的文档时,我发现我可能只有5个热门评论.有任何选项可以获得更多评论.

google-maps-api-3 google-places-api google-my-business-api

17
推荐指数
2
解决办法
1万
查看次数

无需登录即可访问Google My Business API(使用服务帐户)

我想访问与我的帐户及其评论相关联的位置,因为我使用的是Google my business API,我可以访问它(它可以在oAuthplayground上运行).

现在我想访问google my business api而不登录我的帐户,因为我试图让它与服务帐户一起使用.但到目前为止还没有运气,请建议如何继续这样做.我在服务帐户中启用了G套件,并且我还尝试访问我的业务管理的服务帐户电子邮件(ID),但它仍然处于" 邀请"状态,因为无法实际接受邀请.

当我尝试使用我的帐户作为主题发送请求时.

$client = new Google_Client();
$client->addScope('https://www.googleapis.com/auth/plus.business.manage');
$client->setAuthConfig(dirname(__FILE__) . '/Xyz Review API-service account.json');
$client->setSubject('xyz*****abc@gmail.com');
$business_service_class = new Google_Service_Mybusiness($client);
$result_accounts = $business_service_class->accounts->listAccounts();
echo json_encode($result_accounts);
exit;
Run Code Online (Sandbox Code Playgroud)

回复:{"nextPageToken":null}

如果我在主题中使用Google服务帐户ID作为电子邮件ID,那么我会得到以下回复.

$client->setSubject('xyz-review-service@xyz-review-api.iam.gserviceaccount.com');
Run Code Online (Sandbox Code Playgroud)

响应:错误500 {"error":"unauthorized_client","error_description":"请求中未经授权的客户端或范围".}

如果我这样做完全错了,那么请建议如何继续这样做.谢谢.

php google-api google-api-php-client google-my-business-api

11
推荐指数
1
解决办法
2504
查看次数

通过服务帐户访问Google My Business API时出错403

我正在开展一个项目,我们希望通过GMB API收集有关GMB性能的数据.这需要捕获许多reportInsights结果.我们不会为此帐户创建或更新任何记录.然而,我尝试了Oauth2方法,这要求我提供权限,因为我们不访问或更新任何用户数据,我想避免Oauth.

从文档和本用例中,我认为服务帐户是最好的方法,我在Google API控制台中创建了该凭据.

我可以创建凭据,但是,当我运行该进程时,我收到以下错误:

googleapiclient.errors.HttpError: <HttpError 403 when requesting https://mybusiness.googleapis.com/$discovery/rest?version=v3 returned "The request is missing a valid API key.">
Run Code Online (Sandbox Code Playgroud)

这看起来很奇怪,因为我有一组有效的服务帐户凭据.我确实包含了来自Google API控制台的有效API密钥,但我收到了同样的错误.

这是我的Python代码:

import os
import httplib2
import json
import argparse
import apiclient.discovery

from oauth2client.service_account import ServiceAccountCredentials

from apiclient.discovery import build

api_name = 'mybusiness'
api_version = 'v3'
api_key = '<my valid api key from google api console that has permission for this GMB project>'

discovery_uri = 'https://mybusiness.googleapis.com/$discovery/rest?version={}'.format(api_version)

flow_scope='https://www.googleapis.com/auth/plus.business.manage'

credentials_file = '/Google_My_Business-service_account.json' # the service account credentials from the Google API …
Run Code Online (Sandbox Code Playgroud)

python google-oauth google-my-business-api

9
推荐指数
1
解决办法
1571
查看次数

如何在 php 中使用 Google MyBusiness API

我正在使用 Google MyBsiness API 来获取所有业务评论。但我无法熟悉 MYBusiness 中使用的 PHP 语法和 GET、POST 方法。

在誓言之后,这里是我用来获取评论的代码

$mybusinessService = new Google_Service_Mybusiness($client);
$accessToken = file_get_contents($credentialsPath);

$reviews = $mybusinessService->accounts_locations_reviews;
echo '<pre>';print_r($reviews->get('ArtechDev'));exit;
Run Code Online (Sandbox Code Playgroud)

但我收到错误 404(致命错误:未捕获异常 'Google_Service_Exception' 带有消息)

我确定我不知道如何传递 param 以及它需要哪些东西。我以位置为“ArtechDev”的帐户登录,也请告诉我我可以在哪里打电话

https://mybusiness.googleapis.com/v3/accounts/account_name/locations/location_name/reviews

谢谢

php api oauth-2.0 google-my-business-api

6
推荐指数
1
解决办法
9401
查看次数

GMB API - 与 PubSub 合作以获取实时评论通知

我在我们的平台中集成了 GMB API,并与 PubSub 合作以获取实时评论通知。
为此,我已经完成了以下步骤:

  1. 在 google PubSub 云上创建主题
  2. 使用有效的 https url创建推送类型的订阅
  3. 使用在第一步中创建的所有通知类型的主题更新了 Google 企业帐户通知

问题:

  1. 成功完成上述 3 个步骤后,当我转到 My Business API 并编辑评论时,Google 仍未将评论数据推送到我的服务器。
  2. 我是否可以为所有用户创建一个主题并使用单一订阅应用程序,以便当用户通过我们的平台授权他们的 My Business API 时,我们只需要将这些业务与该单个主题相关联以获得他们的通知?

这是我从谷歌的文档中得到的。
任何回应都受到高度赞赏。

谢谢 :)

google-cloud-pubsub google-my-business-api

6
推荐指数
1
解决办法
1223
查看次数

Google 我的商家 API 获取位置个人资料图像或徽标

我正在使用 Google 我的商家 API。我需要检索位置个人资料图像或位置徽标 url。

根据需要MediaItem使用 EnumPROFILELOGO

问题是我发现只有批量请求:

GET https://mybusiness.googleapis.com/v4/{name=accounts/*/locations/*/media/*}
Run Code Online (Sandbox Code Playgroud)

它返回所有位置媒体(任何枚举)。

在这种情况下,我必须运行响应才能找到我正在搜索的项目,并且可能需要运行多个请求才能访问下一个提要页面。

我认为这种做法是不合理的。

也许我错过了一些东西,那么有什么办法可以通过一个请求得到我想要的东西吗?

提前致谢!

google-api google-my-business-api

6
推荐指数
1
解决办法
1464
查看次数

以编程方式接受服务帐号的“Google 我的商家”邀请

我正在尝试使用服务帐户通过 Google 我的商家 API 检索位置/评论。

到目前为止我有:

  1. 在开发者控制台中创建了一个项目
  2. 启用对 Google 我的商家 API 的访问(已被 Google 批准/列入白名单)
  3. 创建具有关联 OAuth 身份的服务帐户
  4. 邀请 OAuth 身份(即服务帐户)作为“Google 我的商家”位置的管理员

当使用 Google 的示例 .NET 客户端(可从https://developers.google.com/my-business/sampleshttps://mybusiness.googleapis.com/v4/accounts/[ACCOUNT NAME]/invitations下载)以编程方式列出邀请时,我可以看到邀请

但是,当我尝试通过请求接受邀请时,请求https://mybusiness.googleapis.com/v4/accounts/[ACCOUNT NAME]/invitations/[INVITATION NAME]:accept失败并出现 500 服务器错误。

创建MyBusinessService实例时,我首先创建一个服务帐户凭据,例如:

ServiceAccountCredential credential;

using (Stream stream = new FileStream("credentials.json", FileMode.Open, FileAccess.Read, FileShare.Read))
{
   credential = (ServiceAccountCredential)GoogleCredential
                   .FromStream(stream)
                   .CreateScoped(new [] { "https://www.googleapis.com/auth/plus.business.manage" })
                   .UnderlyingCredential;
}
Run Code Online (Sandbox Code Playgroud)

接下来我创建一个初始化程序,例如:

var initializer = new BaseClientService.Initializer()
{
   HttpClientInitializer = credential,
   ApplicationName = "My GMB API Client",
   GZipEnabled = …
Run Code Online (Sandbox Code Playgroud)

google-api google-api-dotnet-client google-my-business-api

5
推荐指数
1
解决办法
1518
查看次数

API GMB:删除评论内容中由谷歌翻译的内容

我正在使用 API google mybusiness 来检索帐户位置中的评论。在评论内容中,Google 包含“(由 google 翻译)”,后跟翻译后的文本。有什么办法可以删除这个,我的意思是只获取用户的原始文本,而不需要这个翻译。

谢谢

google-my-business-api

5
推荐指数
1
解决办法
730
查看次数

如何使用谷歌一键登录提取用户的完整信息?

我正在尝试为谷歌我的业务创建一个平台,并且我已经实现了一键登录,并且我获得了凭据,但没有获得完整的信息。这是我尝试过的代码

\n
 <script>\n      window.onload = function () {\n        google.accounts.id.initialize({\n          client_id: "clientid.apps.googleusercontent.com",\n          callback: handleCredentialResponse,\n        });\n        google.accounts.id.prompt((notification) => {\n          if (notification.isNotDisplayed() || notification.isSkippedMoment()) {\n            console.log("opted out");\n          }\n        });\n        function handleCredentialResponse(response) {\n           console.log(response)\n          // window.location = "https://github.com/";\n        }\n      };\n    </script>\n
Run Code Online (Sandbox Code Playgroud)\n

这是我收到的回复

\n
{\n  clientId:\n    "clientid.apps.googleusercontent.com",\n  credential:\n    "eyJhbGciOiJSUzI1NiIsImtpZCI6ImYwNTQxNWIxM2FjYjk1OT\xe2\x80\xa640Jk8v3LcOvtopFD_tI2HMlFjg0dK96XrqNiOD0H3Akl",\n  select_by: "user",\n};\n
Run Code Online (Sandbox Code Playgroud)\n

javascript oauth-2.0 google-identity google-my-business-api

5
推荐指数
2
解决办法
4211
查看次数

Google My Business API 始终返回 429 代码

{ "error": { "code": 429, "message": "配额指标 'Requests' 超出配额,并限制消费者 'project_number:xxx' 服务 'mybusinessaccountmanagement.googleapis.com' 的 'Requests per minute'。 , "errors": [ { "message": "配额指标 'Requests' 超出配额,并限制消费者 'project_number:xxx' 服务 'mybusinessaccountmanagement.googleapis.com' 的 'Requests per minute'。", "domain": "global", "reason": "rateLimitExceeded" } ], "status": "RESOURCE_EXHAUSTED" } }

为什么我登录后立即收到这样的消息?我还没来得及使用api

google-my-business-api

5
推荐指数
1
解决办法
726
查看次数