PHP code example of icedevelop / google-client-api-bundle

1. Go to this page and download the library: Download icedevelop/google-client-api-bundle 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/ */

    

icedevelop / google-client-api-bundle example snippets



//get All Users
        $users=$gSuite->getUsers();

        //Set Email
        $gSuite->setEmail($email);

        //How to update Relations
        $gSuite->setRelationType('manager');
        $gSuite->setRelationValue('[email protected]');
        $gSuite->setRelationCutomType(null);
        $gSuite->updateRelations();

        //how to update Organization

        $gSuite->setOrganizationDepartment('Dipartimento degli stefanini logorroici');
        $gSuite->setOrganizationPrimary(true);
        $gSuite->setOrganizationCustomType(null);
        $gSuite->setOrganizationName('Provola Nome');
        $gSuite->updateOrganization();

        // how to update personale information

        $gSuite->setFullName('Gianluca Mongelli');
        $gSuite->setFamilyName('Mongelli');
        $gSuite->setGivenName('Giangy');
        $gSuite->setTelephonPrimary(true);
        #$gSuite->setTelephonType('work');
        $gSuite->setTelephonNumber('3240537258');
        $gSuite->updatePersonalInformation();

 scope_auth: [ 'https://www.googleapis.com/auth/userinfo.email',
                  'https://www.googleapis.com/auth/userinfo.profile',
                  'https://www.googleapis.com/auth/plus.me',
                  'https://www.googleapis.com/auth/admin.directory.user.readonly',
                  'https://www.googleapis.com/auth/admin.directory.user.alias',
                  'https://www.googleapis.com/auth/admin.directory.group',
                  'https://www.googleapis.com/auth/admin.directory.group.readonly',
                  'https://www.googleapis.com/auth/admin.directory.group.member.readonly',
                  'https://www.googleapis.com/auth/admin.directory.orgunit',
                  'https://www.googleapis.com/auth/admin.directory.orgunit.readonly',
                  'https://www.googleapis.com/auth/admin.directory.user',
                  'https://www.googleapis.com/auth/admin.directory.user.alias.readonly',
                  'https://www.googleapis.com/auth/admin.directory.userschema',
                  'https://www.googleapis.com/auth/admin.directory.domain']