如何使用PHP我的业务API获取谷歌审查回复?

时间:2017-12-11 05:23:32

标签: php google-api google-my-business-api

我正在为我的应用程序使用PHP Google MyBusiness API。我有商业评论。

现在我想获得与特定评论相关的任何回复。我可以发布回复,但我希望使用PHP GMB API获得回复(回复)。

我该怎么做?

1 个答案:

答案 0 :(得分:2)

在您收到回复的reviewReply对象的回复中查看developers.google.com

{
  "reviewId": string,
  "reviewer": {
    object(Reviewer)
  },
  "starRating": enum(StarRating),
  "comment": string,
  "createTime": string,
  "updateTime": string,
  "reviewReply": {
    object(ReviewReply)
  },
}

more info

要获得审核的

使用Google_Service_MyBusiness_AccountsLocationsReviews_Resource

的get方法
class Google_Service_MyBusiness_AccountsLocationsReviews_Resource extends Google_Service_Resource
{

  /**
   * Returns the specified review. This operation is only valid if the specified
   * location is verified. Returns `NOT_FOUND` if the review does not exist, or
   * has been deleted. (reviews.get)
   *
   * @param string $name The name of the review to fetch.
   * @param array $optParams Optional parameters.
   * @return Google_Service_MyBusiness_Review
   */
  public function get($name, $optParams = array())
  {
    $params = array('name' => $name);
    $params = array_merge($params, $optParams);
    return $this->call('get', array($params), "Google_Service_MyBusiness_Review");
  }