2017 © Pedro Peláez
 

library google-sheets-api-php-client

PHP client library for Google Sheets API.

image

ttskch/google-sheets-api-php-client

PHP client library for Google Sheets API.

  • Monday, May 14, 2018
  • by ttskch
  • Repository
  • 1 Watchers
  • 2 Stars
  • 41 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 24 % Grown

The README.md

google-sheets-api-php-client

Latest Stable Version Total Downloads, (*1)

PHP client library for Google Sheets API., (*2)

Requirements

  • PHP 5.6+

Installations

$ composer require ttskch/google-sheets-api-php-client:@dev

Usage

Initializing API client

With OAuth2

// create \Google_Client instance with your OAuth2 client ID.
$googleClient = \Ttskch\GoogleSheetsApi\Factory\GoogleClientFactory::createOAuthClient(
    'client_id',
    'client_secret',
    'redirect_uri',
    'javascript_origin'
);

// authenticate and be athorized.
$authenticator = new \Ttskch\GoogleSheetsApi\Authenticator($googleClient);
if (isset($_GET['code'])) {
    $authenticator->authenticate($_GET['code']);
} else {
    $authenticator->authorize();
}

With Service Account

// create \Google_Client instance with your Service Account credentials json file.
$googleClient = \Ttskch\GoogleSheetsApi\Factory\GoogleClientFactory::createServiceAccountClient('/path/to/service-account-credentials.json');

Using API

// create API client with authorized \Google_Client.
$api = \Ttskch\GoogleSheetsApi\Factory\ApiClientFactory::create($googleClient);

$service = $api->getGoogleService();

// now you can call all apis via $service.
// see \Google_Service_Sheets class to learn more about details.
$service->spreadsheets->...;
$service->spreadsheets_sheets->...;
$service->spreadsheets_values->...;

See also demo., (*3)

The Versions

14/05 2018

dev-master

9999999-dev https://github.com/ttskch/google-sheets-api-php-client

PHP client library for Google Sheets API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Takashi Kanemoto

api rest spreadsheets