return [ /* |---------------------------------------------------------------------------- | Google application name |---------------------------------------------------------------------------- */ 'application_name' => env('GOOGLE_APPLICATION_NAME', ''),
/* |---------------------------------------------------------------------------- | Google OAuth 2.0 access |---------------------------------------------------------------------------- | | Keys for OAuth 2.0 access, see the API console at | https://developers.google.com/console | */ 'redirect_uri' => env('GOOGLE_REDIRECT_URI', ''), 'scopes' => [ 'https://www.googleapis.com/auth/business.manage', 'https://www.googleapis.com/auth/plus.business.manage', ],
/* |---------------------------------------------------------------------------- | Google developer key |---------------------------------------------------------------------------- | | Simple API access key, also from the API console. Ensure you get | a Server key, and not a Browser key. | */ 'developer_key' => env('GOOGLE_DEVELOPER_KEY', ''),
/* |---------------------------------------------------------------------------- | Google service account |---------------------------------------------------------------------------- */ 'service' => [ /* * Path to service account json file. You can also pass the credentials as an array * instead of a file path. */ 'file' => env('GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION', ''), ], ];
撈取商家檔案成效範例
接下來將透過API方式去取得經由商家檔案提出的路線要求次數
觀看文檔可以看到撈取商家相關數據是使用 Business Profile Performance API
$myBusinessAccountLocations = new MyBusinessAccountLocations($client); $reviews = $myBusinessAccountLocations->reviews; $resList = $reviews->listAccountsLocationsReviews('accounts/{acount_id}/locations/{location_id}'); foreach ($resList->getReviews() as$review) { // get the reply to the review $review->getComment(); }