PHP code example of nueip / google-api-client-helper
1. Go to this page and download the library: Download nueip/google-api-client-helper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nueip / google-api-client-helper example snippets
$client = \nueip\google\apiHelper\Client::setClient()
->setApplicationName('Google API')
->setAuthConfig('/path/google_api_secret.json')
->setRedirectUri("http://{$_SERVER['HTTP_HOST']}" . dirname($_SERVER['PHP_SELF'])
->setAccessToken($accessToken)
->getClient();
if ($accessToken = ClientHelper::refreshAccessToken()) {
// saveAccessToken($accessToken)
}
// People Service uses Google_Client from Client helper above
$contacts = \nueip\google\apiHelper\services\People::getSimpleContacts();
use \nueip\google\apiHelper\services\People as PeopleHelper;
\nueip\google\apiHelper\Client::setClient([...])
$contacts = PeopleHelper::getSimpleContacts();
use \nueip\google\apiHelper\services\People as PeopleHelper;
PeopleHelper::setClient($googleClient);
// PeopleHelper::method()...