skip to Main Content

How to debug Google APIs Client Library for PHP error ACCESS_TOKEN_SCOPE_INSUFFICIENT

We're using Google APIs Client Library for PHP (https://github.com/googleapis/google-api-php-client) using authentication with Service Accounts. The code is putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $google_api_key_file_path); $client = new Google_Client(); $client->setApplicationName('Google Translate API'); $client->useApplicationDefaultCredentials(); $client->addScope(Google_Service_Translate::CLOUD_TRANSLATION); $service = new Google_Service_Translate($client); $projects = $service->projects; $postbody = new Google_Service_Translate_TranslateTextRequest();…

VIEW QUESTION
Back To Top
Search