Как получить все фотографии с Google Team Drive с помощью PHP? - PullRequest
0 голосов
/ 13 декабря 2018

Есть ли способ получить все фотографии с диска команды Google с помощью PHP?

<?php 
require_once '/vendor/autoload.php';

$client = new Google_Client();
$client->setApplicationName('Google Drive API PHP Quickstart');
$client->setScopes(Google_Service_Drive::DRIVE);
$client->setAuthConfig(__DIR__ . '/themejson.json');
//$client->setAccessType('offline');
$service = new Google_Service_Drive($client);

$folderId = 'xxxxxxxxxxxxx';
// Print the names and IDs for up to 10 files.
$optParams = array(
  "q" => "'$folderId' in parents",
  'pageSize' => 20,
  'corpora' => "user,allTeamDrives",
  'includeTeamDriveItems' => true,
  'supportsTeamDrives' => true
);
$results = $service->files->listFiles($optParams);

if (count($results->getFiles()) == 0) {
    print "No files found.\n";
} else {
    print "Files:\n";
    foreach ($results->getFiles() as $file) {
        printf("%s (%s)\n", $file->getName(), $file->getId());
    }
}
?>
Я пробовал это с кодом выше, но он не работает должным образом.ничего не возвращаю, когда я использую код выше
...