PHP code example of addin / google-people

1. Go to this page and download the library: Download addin/google-people 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/ */

    

addin / google-people example snippets


use Addin\GoogleContactsManager;

n
$contacts = new GoogleContactsManager('credentials.json','token.json');

$list = $contacts->listContacts(10);
foreach ($list as $person) {
    echo $person->getNames()[0]->getDisplayName() . PHP_EOL;
}

$contacts->addContact('John Doe', '[email protected]');

$contacts->updateContact($resourceName, 'Nama Baru', '[email protected]');

$contacts->deleteContact($resourceName);

$contact->getService()->whatever()->method()->google();
bash
php -S localhost:8080 example/authorize-server.php