Answer the question
In order to leave comments, you need to log in
Google sheets API do I understand Authorization correctly?
There is a MySql table, I just want to transfer data from it to Google sheets, but I got confused with Google_Client.
Can I use only the API key for this?
Using API Keys
https://developers.google.com/api-client-library/p...
When calling APIs that do not access private user data, you can use simple API keys.
require_once __DIR__ . '/vendor/autoload.php';
$client = getClient();
$service = new Google_Service_Sheets($client);
// The ID of the spreadsheet to retrieve data from.
$spreadsheetId = 'id моего файла excel'; // TODO: Update placeholder value.
// The A1 notation of the values to retrieve.
$range = 'имя страницы excel'; // TODO: Update placeholder value.
$response = $service->spreadsheets_values->get($spreadsheetId, $range);
// TODO: Change code below to process the `response` object:
echo '<pre>', var_export($response, true), '</pre>', "\n";
function getClient() {
$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$client->setDeveloperKey("мой api key");
return $client;
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question