How to download files from google drive through PHP?

Follow the examples here:
And here:

A list of disk files are already removed, you need to do the download. But here was the catch.
Right put wide:
Trying to get the file to the following (the project on Yii2):
public function actionDownload($fileId)
 $service = GoogleDocsConsole::getService(); // Instance Google_Service_Drive 
 $response = $service->files->export($fileId, 'application/pdf', [
 'alt' => 'media'

 $content = $response->getBody()->getContents();
 return $content;

In the end I see the error:
"error": {
"errors": [
"domain": "global",
"reason": "insufficientPermissions",
"message": "Insufficient Permission"
"code": 403,
"message": "Insufficient Permission"

What am I doing wrong?
June 7th 19 at 15:05
0 answer

Find more questions by tags PHPAPIGoogle Drive