如何使用PHP我的业务API获取Google评论回复



我正在使用PHP Google MyBusiness API进行我的应用程序。我有业务评论。

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

我该怎么办?

请参见developers.google.com在响应中,您获得了reviewReply对象,该对象容纳您的回复

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

更多信息

获得评论使用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");
  }

最新更新