{"action":"closed","issue":{"url":"https://api.github.com/repos/asimlqt/php-google-spreadsheet-client/issues/43","repository_url":"https://api.github.com/repos/asimlqt/php-google-spreadsheet-client","labels_url":"https://api.github.com/repos/asimlqt/php-google-spreadsheet-client/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/asimlqt/php-google-spreadsheet-client/issues/43/comments","events_url":"https://api.github.com/repos/asimlqt/php-google-spreadsheet-client/issues/43/events","html_url":"https://github.com/asimlqt/php-google-spreadsheet-client/issues/43","id":51931391,"number":43,"title":"Fatal error: Uncaught exception 'Google\\Spreadsheet\\UnauthorizedException' with message 'Access token is invalid' or Fatal error: Uncaught exception 'Google_Auth_Exception' with message 'Error fetching OAuth2 access token, message: 'invalid_grant: i''","user":{"login":"nekromoff","id":8550349,"avatar_url":"https://avatars.githubusercontent.com/u/8550349?v=3","gravatar_id":"","url":"https://api.github.com/users/nekromoff","html_url":"https://github.com/nekromoff","followers_url":"https://api.github.com/users/nekromoff/followers","following_url":"https://api.github.com/users/nekromoff/following{/other_user}","gists_url":"https://api.github.com/users/nekromoff/gists{/gist_id}","starred_url":"https://api.github.com/users/nekromoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nekromoff/subscriptions","organizations_url":"https://api.github.com/users/nekromoff/orgs","repos_url":"https://api.github.com/users/nekromoff/repos","events_url":"https://api.github.com/users/nekromoff/events{/privacy}","received_events_url":"https://api.github.com/users/nekromoff/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-12-14T20:55:19Z","updated_at":"2016-03-17T21:48:36Z","closed_at":"2016-03-17T21:48:36Z","body":"I have this problem, I always get this:\r\n\r\n{\"access_token\":\"ya29.3AAc-8mXbyHSaOFS_TJJX4dkrvH92eY956HV5ZyR1mR6gTnQnr-jPzZkDEa0rJl9pOaR4lJ3DdGJuQ\",\"token_type\":\"Bearer\",\"expires_in\":3600,\"created\":1418520786}\r\nFatal error: Uncaught exception 'Google\\Spreadsheet\\UnauthorizedException' with message 'Access token is invalid' in /whatever/vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/DefaultServiceRequest.php:240 Stack trace: #0 /whatever/vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/DefaultServiceRequest.php(131): Google\\Spreadsheet\\DefaultServiceRequest->execute(Resource id #46) #1 /whatever/vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/SpreadsheetService.php(38): Google\\Spreadsheet\\DefaultServiceRequest->get('feeds/spreadshe...') #2 /whatever/sample.php(27): Google\\Spreadsheet\\SpreadsheetService->getSpreadsheets() #3 {main} thrown in /whatever/vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/DefaultServiceRequest.php on line 240\r\n\r\nscopes:\r\n$client->setScopes(array('https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive','https://docs.google.com/feeds/'));\r\n\r\nspreadsheet access code:\r\n$serviceRequest = new Google\\Spreadsheet\\DefaultServiceRequest($token['access_token']);\r\nGoogle\\Spreadsheet\\ServiceRequestFactory::setInstance($serviceRequest);\r\n$spreadsheetService = new Google\\Spreadsheet\\SpreadsheetService();\r\n$spreadsheetFeed = $spreadsheetService->getSpreadsheets();\r\n\r\nsometimes i get this instead:\r\nFatal error: Uncaught exception 'Google_Auth_Exception' with message 'Error fetching OAuth2 access token, message: 'invalid_grant: i'' in /whatever/vendor/google/apiclient/src/Google/Auth/OAuth2.php:127 Stack trace: #0 /whatever/vendor/google/apiclient/src/Google/Client.php(130): Google_Auth_OAuth2->authenticate('4/gGfFncBJOs5id...') #1 /whatever/sample.php(19): Google_Client->authenticate('4/gGfFncBJOs5id...') #2 {main} thrown in /whatever/vendor/google/apiclient/src/Google/Auth/OAuth2.php on line 127\r\n"}}