Is there any way to get all photos from Google team drive using 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.
";
} else {
print "Files:
";
foreach ($results->getFiles() as $file) {
printf("%s (%s)
", $file->getName(), $file->getId());
}
}
?>
I tried it with above code but it's not working properly. nothing return when I using above code