Google 我的商家 API - 帐户 ID 位置

问题描述 投票:0回答:3

获取 https://mybusiness.googleapis.com/v4/accounts/{**accountId**}/locations/{locationId}/reviews/{reviewId}

accountID 在 API 文档中位于哪里?

google-my-business-api
3个回答
3
投票

为了理解你应该好好学习[https://developers.google.com/my-business/content/overview],然后[https://developers.google.com/my-business/ref_overview]

您似乎只是对在游乐场工作感兴趣 [https://developers.google.com/oauthplayground] 一步步前进: 从 [https://console.cloud.google.com/apis/credentials] 复制您的 clientId 并在选择 OAuth 流程时将其用作 OAuth 客户端 ID =客户端,看照片:

然后输入https://developers.google.com/oauthplayground,如下图所示

然后按授权 API,接下来您需要使用您要执行所有这些操作的客户端的用户名和密码登录。 之后你可以在操场上工作一个小时。如果时间到期,您应该再次执行上述步骤。 正如下面的照片中突出显示的那样,您应该输入值: 您在照片中看到的请求 URI 即将被弃用,新的 URI 是 https://mybusinessaccountmanagement.googleapis.com/v1/accounts 或者 https://mybusinessbusinessinformation.googleapis.com/v1/accounts

最后,在右侧窗口中,您会收到一个 json 响应,您可以在其中看到 accountId


1
投票

我会解释如何找到帐户ID。

获取 如果您运行 https://mybusiness.googleapis.com/v4/accounts

您将需要使用 OAuth2.0 进行身份验证。 如果认证通过, 例如,会出现类似“name”:“accounts/1234555”的内容。 现在,“123455”是您的 mybusiness 的 accountID。


0
投票

我使用以下请求 URI:

账户ID

https://mybusinessaccountmanagement.googleapis.com/v1/accounts

回报是:

{
  "accounts": [
    {
      ...
      "name": "accounts/{YOUR_ACCOUNT_ID}", 
      ...
    }
  ]
}

位置ID

https://mybusinessbusinessinformation.googleapis.com/v1/accounts/{locationId}/locations?readMask=name

注意:readMask参数为必填项

回报是:

{
  "locations": [
    {
      "name": "locations/{YOUR_LOCATION_ID}"
    }
  ]
}

这些可以在 Google OAuth 2.0 Playground 中使用 - 您可以按照 Shila 的屏幕截图,并在“配置 API 请求”部分中使用它们。

© www.soinside.com 2019 - 2024. All rights reserved.