I would like to export data to google sheets, I downloaded quickstart.php script from https://developers.google.com/sheets/api/quickstart/php I launched script from cli, it asks a "Enter verification code:" and give me a url to open with browser, I allow permission and redirect to a script I have to my server which display array it receives:
[access_token] => ....
[expires_in] => 3599
[refresh_token] => ...
[scope] => ....
[token_type] => Bearer
[created] => 1589307422
I paste access_token to cli asking code but it returns:
PHP Fatal error: Uncaught InvalidArgumentException: Invalid token format in /var/www/html/vendor/google/apiclient/src/Google/Client.php:449
Stack trace:
#0 /var/www/html/quickstart.php(45): Google_Client->setAccessToken(Array)
#1 /var/www/html/quickstart.php(63): getClient()
#2 {main}
thrown in /var/www/html//vendor/google/apiclient/src/Google/Client.php on line 449
What is wrong ?