I am using below code to call Google Sheet API
$client = new \Google_Client(); $client->setApplicationName('Google Sheets API'); $client->setScopes([\Google_Service_Sheets::SPREADSHEETS]); $path = public_path('google_spreadhsheet/credentials.json'); $client->setAuthConfig($path); $service = new \Google_Service_Sheets($client); $spreadsheetId = "<SPREADSHEET_ID>"; $spreadsheet = $service->spreadsheets->get($spreadsheetId); $range = 'Sheet1'; $response = $service->spreadsheets_values->get($spreadsheetId, $range); and getting below response
{ "message": "{\n \"error\": {\n \"code\": 403,\n \"message\": \"The caller does not have permission\",\n \"errors\": [\n {\n \"message\": \"The caller does not have permission\",\n \"domain\": \"global\",\n \"reason\": \"forbidden\"\n }\n ],\n \"status\": \"PERMISSION_DENIED\"\n }\n}\n", "exception": "Google\\Service\\Exception", "file": "/var/www/html/vendor/google/apiclient/src/Http/REST.php", "line": 134, }